Skip to content

Commit

Permalink
chore: Enforce ban-untagged-todo lint rule (denoland#9135)
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju committed Jan 16, 2021
1 parent fc45a19 commit b26dcbc
Show file tree
Hide file tree
Showing 31 changed files with 77 additions and 58 deletions.
9 changes: 9 additions & 0 deletions .dlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"rules": {
"tags": ["recommended"],
"include": [
"ban-untagged-todo"
],
"exclude": []
}
}
2 changes: 1 addition & 1 deletion cli/bench/deno_tcp.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
// Used for benchmarking Deno's networking.
// TODO Replace this with a real HTTP server once
// TODO(bartlomieju): Replace this with a real HTTP server once
// https://github.com/denoland/deno/issues/726 is completed.
// Note: this is a keep-alive server.
const addr = Deno.args[0] || "127.0.0.1:4500";
Expand Down
4 changes: 2 additions & 2 deletions cli/tests/unit/buffer_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ unitTest(async function bufferBasicOperations(): Promise<void> {
await empty(buf, testString.slice(0, 20), new Uint8Array(5));
await empty(buf, "", new Uint8Array(100));

// TODO buf.writeByte()
// TODO buf.readByte()
// TODO(bartlomieju): buf.writeByte()
// TODO(bartlomieju): buf.readByte()
}
});

Expand Down
4 changes: 2 additions & 2 deletions cli/tests/unit/chown_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ unitTest(
unitTest(
{ perms: { run: true, write: true }, ignore: Deno.build.os == "windows" },
async function chownSyncSucceed(): Promise<void> {
// TODO: when a file's owner is actually being changed,
// TODO(bartlomieju): when a file's owner is actually being changed,
// chown only succeeds if run under priviledged user (root)
// The test script has no such privilege, so need to find a better way to test this case
const { uid, gid } = await getUidAndGid();
Expand Down Expand Up @@ -152,7 +152,7 @@ unitTest(
unitTest(
{ perms: { run: true, write: true }, ignore: Deno.build.os == "windows" },
async function chownWithUrl(): Promise<void> {
// TODO: same as chownSyncSucceed
// TODO(bartlomieju): same as chownSyncSucceed
const { uid, gid } = await getUidAndGid();

const enc = new TextEncoder();
Expand Down
8 changes: 4 additions & 4 deletions cli/tests/unit/files_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ unitTest(
// deno-lint-ignore no-explicit-any
await file.write(null as any);
},
); // TODO: Check error kind when dispatch_minimal pipes errors properly
); // TODO(bartlomieju): Check error kind when dispatch_minimal pipes errors properly
file.close();
await Deno.remove(tempDir, { recursive: true });
},
Expand All @@ -349,7 +349,7 @@ unitTest(
// deno-lint-ignore no-explicit-any
await file.read(null as any);
}, TypeError);
// TODO: Check error kind when dispatch_minimal pipes errors properly
// TODO(bartlomieju): Check error kind when dispatch_minimal pipes errors properly

file.close();
await Deno.remove(tempDir, { recursive: true });
Expand Down Expand Up @@ -382,7 +382,7 @@ unitTest(
assert(fileInfo.size === 5);
f.close();

// TODO: test different modes
// TODO(bartlomieju): test different modes
await Deno.remove(tempDir, { recursive: true });
},
);
Expand Down Expand Up @@ -425,7 +425,7 @@ unitTest(
assert(fileInfo.size === 5);
f.close();

// TODO: test different modes
// TODO(bartlomieju): test different modes
await Deno.remove(tempDir, { recursive: true });
},
);
Expand Down
2 changes: 1 addition & 1 deletion op_crates/fetch/20_headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

const headersData = Symbol("headers data");

// TODO: headerGuard? Investigate if it is needed
// TODO(bartlomieju): headerGuard? Investigate if it is needed
// node-fetch did not implement this but it is in the spec
function normalizeParams(name, value) {
name = String(name).toLowerCase();
Expand Down
4 changes: 2 additions & 2 deletions op_crates/fetch/26_fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
}

function getStream(blobBytes) {
// TODO: Align to spec https://fetch.spec.whatwg.org/#concept-construct-readablestream
// TODO(bartlomieju): Align to spec https://fetch.spec.whatwg.org/#concept-construct-readablestream
return new ReadableStream({
type: "bytes",
start: (controller) => {
Expand Down Expand Up @@ -1240,7 +1240,7 @@
let body;
let clientRid = null;
let redirected = false;
let remRedirectCount = 20; // TODO: use a better way to handle
let remRedirectCount = 20; // TODO(bartlomieju): use a better way to handle

if (typeof input === "string" || input instanceof URL) {
url = typeof input === "string" ? input : input.href;
Expand Down
2 changes: 1 addition & 1 deletion op_crates/web/01_event.js
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,7 @@
setRelatedTarget(eventImpl, null);
}

// TODO: invoke activation targets if HTML nodes will be implemented
// TODO(bartlomieju): invoke activation targets if HTML nodes will be implemented
// if (activationTarget !== null) {
// if (!eventImpl.defaultPrevented) {
// activationTarget._activationBehavior();
Expand Down
2 changes: 1 addition & 1 deletion op_crates/web/21_filereader.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
if (!chunk.done && chunk.value instanceof Uint8Array) {
chunks.push(chunk.value);

// TODO: (only) If roughly 50ms have passed since last progress
// TODO(bartlomieju): (only) If roughly 50ms have passed since last progress
{
const size = chunks.reduce((p, i) => p + i.byteLength, 0);
const ev = new ProgressEvent("progress", {
Expand Down
4 changes: 2 additions & 2 deletions runtime/js/40_testing.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ finishing test case.`;

exposeForTest("reportToConsole", reportToConsole);

// TODO: already implements AsyncGenerator<RunTestsMessage>, but add as "implements to class"
// TODO: implements PromiseLike<RunTestsEndResult>
// TODO(bartlomieju): already implements AsyncGenerator<RunTestsMessage>, but add as "implements to class"
// TODO(bartlomieju): implements PromiseLike<RunTestsEndResult>
class TestRunner {
#usedOnly = false;

Expand Down
2 changes: 1 addition & 1 deletion runtime/js/99_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ delete Object.prototype.__proto__;
self: util.readOnly(globalThis),
onmessage: util.writable(onmessage),
onerror: util.writable(onerror),
// TODO: should be readonly?
// TODO(bartlomieju): should be readonly?
close: util.nonEnumerable(workerClose),
postMessage: util.writable(postMessage),
workerMessageRecvCallback: util.nonEnumerable(workerMessageRecvCallback),
Expand Down
2 changes: 1 addition & 1 deletion std/encoding/_yaml/loader/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ function readDoubleQuotedScalar(
if (isEOL(ch)) {
skipSeparationSpace(state, false, nodeIndent);

// TODO: rework to inline fn with no type cast?
// TODO(bartlomieju): rework to inline fn with no type cast?
} else if (ch < 256 && simpleEscapeCheck[ch]) {
state.result += simpleEscapeMap[ch];
state.position++;
Expand Down
2 changes: 1 addition & 1 deletion std/encoding/toml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ class Parser {
for (let i = 0; i < this.tomlLines.length; i++) {
const line = this.tomlLines[i];

// TODO (zekth) Handle unflat of array of tables
// TODO(zekth): Handle unflat of array of tables
if (this._isGroup(line)) {
// if the current group is an array we push the
// parsed objects in it.
Expand Down
5 changes: 3 additions & 2 deletions std/fmt/printf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ class Printf {
}
} // switch c
break;
case State.POSITIONAL: // either a verb or * only verb for now, TODO
case State.POSITIONAL:
// TODO(bartlomieju): either a verb or * only verb for now
if (c === "*") {
const worp = this.flags.precision === -1
? WorP.WIDTH
Expand Down Expand Up @@ -689,7 +690,7 @@ class Printf {
if (i !== 0 && this.flags.space) {
hex += sharp ? " 0x" : " ";
}
// TODO: for now only taking into account the
// TODO(bartlomieju): for now only taking into account the
// lower half of the codePoint, ie. as if a string
// is a list of 8bit values instead of UCS2 runes
const c = (val.charCodeAt(i) & 0xff).toString(16);
Expand Down
24 changes: 15 additions & 9 deletions std/fmt/printf_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,17 +266,18 @@ const tests: Array<[string, any, string]> = [
["%3c", "⌘".charCodeAt(0), " ⌘"],
["%-3c", "⌘".charCodeAt(0), "⌘ "],
// Runes that are not printable.
// {"%c", '\U00000e00', "\u0e00"}, // TODO check if \U escape exists in js
// {"%c", '\U00000e00', "\u0e00"},
// TODO(bartlomieju) check if \U escape exists in js
//["%c", '\U0010ffff'.codePointAt(0), "\U0010ffff"],

// Runes that are not valid.
["%c", -1, "�"],
// TODO surrogate half, doesn't make sense in itself, how
// TODO(bartomieju): surrogate half, doesn't make sense in itself, how
// to determine in JS?
// ["%c", 0xDC80, "�"],
["%c", 0x110000, "�"],
["%c", 0xfffffffff, "�"],
// TODO
// TODO(bartlomieju):
// escaped characters
// Runes that are not printable.
// Runes that are not valid.
Expand All @@ -291,7 +292,8 @@ const tests: Array<[string, any, string]> = [
["%.0s", "日本語日本語", ""],
["%.5s", "日本語日本語", "日本語日本"],
["%.10s", "日本語日本語", "日本語日本語"],
// ["%08q", "abc", `000"abc"`], // TODO verb q
// ["%08q", "abc", `000"abc"`],
// TODO(bartlomieju): verb q
// ["%-8q", "abc", `"abc" `],
//["%.5q", "abcdefghijklmnopqrstuvwxyz", `"abcde"`],
["%.5x", "abcdefghijklmnopqrstuvwxyz", "6162636465"],
Expand All @@ -301,7 +303,8 @@ const tests: Array<[string, any, string]> = [
// our %x takes lower byte of string "%.1x", "日本語", "e6"],,
["%.1x", "日本語", "e5"],
//["%10.1q", "日本語日本語", ` "日"`],
// ["%10v", null, " <nil>"], // TODO null, undefined ...
// ["%10v", null, " <nil>"],
// TODO(bartlomieju): null, undefined ...
// ["%-10v", null, "<nil> "],

// integers
Expand Down Expand Up @@ -353,8 +356,10 @@ const tests: Array<[string, any, string]> = [
["%-#20.8x", 0x1234abc, "0x01234abc "],
["%-#20.8X", 0x1234abc, "0X01234ABC "],
["%-#20.8o", parseInt("01234", 8), "00001234 "],
// Test correct f.intbuf overflow checks. // TODO, lazy
// unicode format // TODO, decide whether unicode verb makes sense %U
// Test correct f.intbuf overflow checks.
// TODO(bartlomieju): lazy
// unicode format
// TODO(bartlomieju): decide whether unicode verb makes sense %U

// floats
["%+.3e", 0.0, "+0.000e+00"],
Expand Down Expand Up @@ -490,10 +495,11 @@ const tests: Array<[string, any, string]> = [
["%g", 1.23456789e-3, "0.00123457"], // see above prec6 = precdef6 - (-3+1)
//["%g", 1.23456789e20, "1.23456789e+20"],
["%g", 1.23456789e20, "1.23457e+20"],
// arrays // TODO
// arrays
// TODO(bartlomieju):
// slice : go specific

// TODO decide how to handle deeper types, arrays, objects
// TODO(bartlomieju): decide how to handle deeper types, arrays, objects
// byte arrays and slices with %b,%c,%d,%o,%U and %v
// f.space should and f.plus should not have an effect with %v.
// f.space and f.plus should have an effect with %d.
Expand Down
2 changes: 1 addition & 1 deletion std/fs/copy_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ testCopySync(

assert(destStatInfo.atime instanceof Date);
assert(destStatInfo.mtime instanceof Date);
// TODO: Activate test when https://github.com/denoland/deno/issues/2411
// TODO(bartlomieju): Activate test when https://github.com/denoland/deno/issues/2411
// is fixed
// assertEquals(destStatInfo.atime, srcStatInfo.atime);
// assertEquals(destStatInfo.mtime, srcStatInfo.mtime);
Expand Down
1 change: 0 additions & 1 deletion std/fs/expand_glob.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ interface SplitPath {
winRoot?: string;
}

// TODO: Maybe make this public somewhere.
function split(path: string): SplitPath {
const s = SEP_PATTERN.source;
const segments = path
Expand Down
2 changes: 1 addition & 1 deletion std/http/_io.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function chunkedBodyReader(h: Headers, r: BufReader): Deno.Reader {
}
const line = await tp.readLine();
if (line === null) throw new Deno.errors.UnexpectedEof();
// TODO: handle chunk extension
// TODO(bartlomieju): handle chunk extension
const [chunkSizeString] = line.split(";");
const chunkSize = parseInt(chunkSizeString, 16);
if (Number.isNaN(chunkSize) || chunkSize < 0) {
Expand Down
2 changes: 1 addition & 1 deletion std/http/cookie.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ export function setCookie(res: { headers?: Headers }, cookie: Cookie): void {
if (!res.headers) {
res.headers = new Headers();
}
// TODO (zekth) : Add proper parsing of Set-Cookie headers
// TODO(zekth) : Add proper parsing of Set-Cookie headers
// Parsing cookie headers to make consistent set-cookie header
// ref: https://tools.ietf.org/html/rfc6265#section-4.1.1
const v = toString(cookie);
Expand Down
6 changes: 3 additions & 3 deletions std/http/file_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.

// This program serves files in the current directory over HTTP.
// TODO Stream responses instead of reading them into memory.
// TODO Add tests like these:
// TODO(bartlomieju): Stream responses instead of reading them into memory.
// TODO(bartlomieju): Add tests like these:
// https://github.com/indexzero/http-server/blob/master/test/http-server-test.js

import { extname, posix } from "../path/mod.ts";
Expand Down Expand Up @@ -141,7 +141,7 @@ export async function serveFile(
};
}

// TODO: simplify this after deno.stat and deno.readDir are fixed
// TODO(bartlomieju): simplify this after deno.stat and deno.readDir are fixed
async function serveDir(
req: ServerRequest,
dirPath: string,
Expand Down
2 changes: 1 addition & 1 deletion std/http/file_server_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Deno.test("serveDirectory", async function (): Promise<void> {
assert(page.includes("README.md"));

// `Deno.FileInfo` is not completely compatible with Windows yet
// TODO: `mode` should work correctly in the future.
// TODO(bartlomieju): `mode` should work correctly in the future.
// Correct this test case accordingly.
Deno.build.os !== "windows" &&
assert(/<td class="mode">(\s)*\([a-zA-Z-]{10}\)(\s)*<\/td>/.test(page));
Expand Down
2 changes: 1 addition & 1 deletion std/io/bufio_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const readMakers: ReadMaker[] = [
fn: (r): iotest.OneByteReader => new iotest.OneByteReader(r),
},
{ name: "half", fn: (r): iotest.HalfReader => new iotest.HalfReader(r) },
// TODO { name: "data+err", r => new iotest.DataErrReader(r) },
// TODO(bartlomieju): { name: "data+err", r => new iotest.DataErrReader(r) },
// { name: "timeout", fn: r => new iotest.TimeoutReader(r) },
];

Expand Down
2 changes: 1 addition & 1 deletion std/mime/multipart_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ Deno.test({
assert(file.tempfile != null);
assertEquals(file.size, size);
assertEquals(file.type, "application/octet-stream");
// TODO checksum of tmp & sampleFile
// TODO(bartlomieju): checksum of tmp & sampleFile
} finally {
await Deno.remove(multipartFile);
await Deno.remove(sampleFile);
Expand Down
6 changes: 3 additions & 3 deletions std/node/_fs/_fs_access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { notImplemented } from "../_utils.ts";

/** Revist once https://github.com/denoland/deno/issues/4017 lands */

//TODO - 'path' can also be a Buffer. Neither of these polyfills
// TODO(bartlomieju) 'path' can also be a Buffer. Neither of these polyfills
//is available yet. See https://github.com/denoland/deno/issues/3403
export function access(
_path: string | URL,
Expand All @@ -14,8 +14,8 @@ export function access(
notImplemented("Not yet available");
}

//TODO - 'path' can also be a Buffer. Neither of these polyfills
//is available yet. See https://github.com/denoland/deno/issues/3403
// TODO(bartlomieju) 'path' can also be a Buffer. Neither of these polyfills
// is available yet. See https://github.com/denoland/deno/issues/3403
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export function accessSync(path: string | URL, mode?: number): void {
notImplemented("Not yet available");
Expand Down
4 changes: 2 additions & 2 deletions std/node/_fs/_fs_appendFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function appendFile(
: undefined;

if (mode) {
//TODO rework once https://github.com/denoland/deno/issues/4017 completes
// TODO(bartlomieju) rework once https://github.com/denoland/deno/issues/4017 completes
notImplemented("Deno does not yet support setting mode on create");
}
Deno.open(pathOrRid as string, getOpenOptions(flag))
Expand Down Expand Up @@ -100,7 +100,7 @@ export function appendFileSync(
: undefined;

if (mode) {
// TODO rework once https://github.com/denoland/deno/issues/4017 completes
// TODO(bartlomieju) rework once https://github.com/denoland/deno/issues/4017 completes
notImplemented("Deno does not yet support setting mode on create");
}

Expand Down
2 changes: 1 addition & 1 deletion std/node/global_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import timers from "./timers.ts";
// Definitions for this are quite delicate
// This ensures modifications to the global namespace don't break on TypeScript

// TODO
// TODO(bartlomieju):
// Deno lint marks globals defined by this module as undefined
// probably gonna change in the future

Expand Down
Loading

0 comments on commit b26dcbc

Please sign in to comment.