Skip to content

Commit b26dcbc

Browse files
authored
chore: Enforce ban-untagged-todo lint rule (denoland#9135)
1 parent fc45a19 commit b26dcbc

31 files changed

+77
-58
lines changed

.dlint.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"rules": {
3+
"tags": ["recommended"],
4+
"include": [
5+
"ban-untagged-todo"
6+
],
7+
"exclude": []
8+
}
9+
}

cli/bench/deno_tcp.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
22
// Used for benchmarking Deno's networking.
3-
// TODO Replace this with a real HTTP server once
3+
// TODO(bartlomieju): Replace this with a real HTTP server once
44
// https://github.com/denoland/deno/issues/726 is completed.
55
// Note: this is a keep-alive server.
66
const addr = Deno.args[0] || "127.0.0.1:4500";

cli/tests/unit/buffer_test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,8 @@ unitTest(async function bufferBasicOperations(): Promise<void> {
128128
await empty(buf, testString.slice(0, 20), new Uint8Array(5));
129129
await empty(buf, "", new Uint8Array(100));
130130

131-
// TODO buf.writeByte()
132-
// TODO buf.readByte()
131+
// TODO(bartlomieju): buf.writeByte()
132+
// TODO(bartlomieju): buf.readByte()
133133
}
134134
});
135135

cli/tests/unit/chown_test.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ unitTest(
9696
unitTest(
9797
{ perms: { run: true, write: true }, ignore: Deno.build.os == "windows" },
9898
async function chownSyncSucceed(): Promise<void> {
99-
// TODO: when a file's owner is actually being changed,
99+
// TODO(bartlomieju): when a file's owner is actually being changed,
100100
// chown only succeeds if run under priviledged user (root)
101101
// The test script has no such privilege, so need to find a better way to test this case
102102
const { uid, gid } = await getUidAndGid();
@@ -152,7 +152,7 @@ unitTest(
152152
unitTest(
153153
{ perms: { run: true, write: true }, ignore: Deno.build.os == "windows" },
154154
async function chownWithUrl(): Promise<void> {
155-
// TODO: same as chownSyncSucceed
155+
// TODO(bartlomieju): same as chownSyncSucceed
156156
const { uid, gid } = await getUidAndGid();
157157

158158
const enc = new TextEncoder();

cli/tests/unit/files_test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ unitTest(
322322
// deno-lint-ignore no-explicit-any
323323
await file.write(null as any);
324324
},
325-
); // TODO: Check error kind when dispatch_minimal pipes errors properly
325+
); // TODO(bartlomieju): Check error kind when dispatch_minimal pipes errors properly
326326
file.close();
327327
await Deno.remove(tempDir, { recursive: true });
328328
},
@@ -349,7 +349,7 @@ unitTest(
349349
// deno-lint-ignore no-explicit-any
350350
await file.read(null as any);
351351
}, TypeError);
352-
// TODO: Check error kind when dispatch_minimal pipes errors properly
352+
// TODO(bartlomieju): Check error kind when dispatch_minimal pipes errors properly
353353

354354
file.close();
355355
await Deno.remove(tempDir, { recursive: true });
@@ -382,7 +382,7 @@ unitTest(
382382
assert(fileInfo.size === 5);
383383
f.close();
384384

385-
// TODO: test different modes
385+
// TODO(bartlomieju): test different modes
386386
await Deno.remove(tempDir, { recursive: true });
387387
},
388388
);
@@ -425,7 +425,7 @@ unitTest(
425425
assert(fileInfo.size === 5);
426426
f.close();
427427

428-
// TODO: test different modes
428+
// TODO(bartlomieju): test different modes
429429
await Deno.remove(tempDir, { recursive: true });
430430
},
431431
);

op_crates/fetch/20_headers.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
const headersData = Symbol("headers data");
1818

19-
// TODO: headerGuard? Investigate if it is needed
19+
// TODO(bartlomieju): headerGuard? Investigate if it is needed
2020
// node-fetch did not implement this but it is in the spec
2121
function normalizeParams(name, value) {
2222
name = String(name).toLowerCase();

op_crates/fetch/26_fetch.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@
283283
}
284284

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

12451245
if (typeof input === "string" || input instanceof URL) {
12461246
url = typeof input === "string" ? input : input.href;

op_crates/web/01_event.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@
668668
setRelatedTarget(eventImpl, null);
669669
}
670670

671-
// TODO: invoke activation targets if HTML nodes will be implemented
671+
// TODO(bartlomieju): invoke activation targets if HTML nodes will be implemented
672672
// if (activationTarget !== null) {
673673
// if (!eventImpl.defaultPrevented) {
674674
// activationTarget._activationBehavior();

op_crates/web/21_filereader.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
if (!chunk.done && chunk.value instanceof Uint8Array) {
6262
chunks.push(chunk.value);
6363

64-
// TODO: (only) If roughly 50ms have passed since last progress
64+
// TODO(bartlomieju): (only) If roughly 50ms have passed since last progress
6565
{
6666
const size = chunks.reduce((p, i) => p + i.byteLength, 0);
6767
const ev = new ProgressEvent("progress", {

runtime/js/40_testing.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ finishing test case.`;
199199

200200
exposeForTest("reportToConsole", reportToConsole);
201201

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

runtime/js/99_main.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ delete Object.prototype.__proto__;
278278
self: util.readOnly(globalThis),
279279
onmessage: util.writable(onmessage),
280280
onerror: util.writable(onerror),
281-
// TODO: should be readonly?
281+
// TODO(bartlomieju): should be readonly?
282282
close: util.nonEnumerable(workerClose),
283283
postMessage: util.writable(postMessage),
284284
workerMessageRecvCallback: util.nonEnumerable(workerMessageRecvCallback),

std/encoding/_yaml/loader/loader.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ function readDoubleQuotedScalar(
667667
if (isEOL(ch)) {
668668
skipSeparationSpace(state, false, nodeIndent);
669669

670-
// TODO: rework to inline fn with no type cast?
670+
// TODO(bartlomieju): rework to inline fn with no type cast?
671671
} else if (ch < 256 && simpleEscapeCheck[ch]) {
672672
state.result += simpleEscapeMap[ch];
673673
state.position++;

std/encoding/toml.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ class Parser {
464464
for (let i = 0; i < this.tomlLines.length; i++) {
465465
const line = this.tomlLines[i];
466466

467-
// TODO (zekth) Handle unflat of array of tables
467+
// TODO(zekth): Handle unflat of array of tables
468468
if (this._isGroup(line)) {
469469
// if the current group is an array we push the
470470
// parsed objects in it.

std/fmt/printf.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ class Printf {
151151
}
152152
} // switch c
153153
break;
154-
case State.POSITIONAL: // either a verb or * only verb for now, TODO
154+
case State.POSITIONAL:
155+
// TODO(bartlomieju): either a verb or * only verb for now
155156
if (c === "*") {
156157
const worp = this.flags.precision === -1
157158
? WorP.WIDTH
@@ -689,7 +690,7 @@ class Printf {
689690
if (i !== 0 && this.flags.space) {
690691
hex += sharp ? " 0x" : " ";
691692
}
692-
// TODO: for now only taking into account the
693+
// TODO(bartlomieju): for now only taking into account the
693694
// lower half of the codePoint, ie. as if a string
694695
// is a list of 8bit values instead of UCS2 runes
695696
const c = (val.charCodeAt(i) & 0xff).toString(16);

std/fmt/printf_test.ts

+15-9
Original file line numberDiff line numberDiff line change
@@ -266,17 +266,18 @@ const tests: Array<[string, any, string]> = [
266266
["%3c", "⌘".charCodeAt(0), " ⌘"],
267267
["%-3c", "⌘".charCodeAt(0), "⌘ "],
268268
// Runes that are not printable.
269-
// {"%c", '\U00000e00', "\u0e00"}, // TODO check if \U escape exists in js
269+
// {"%c", '\U00000e00', "\u0e00"},
270+
// TODO(bartlomieju) check if \U escape exists in js
270271
//["%c", '\U0010ffff'.codePointAt(0), "\U0010ffff"],
271272

272273
// Runes that are not valid.
273274
["%c", -1, "�"],
274-
// TODO surrogate half, doesn't make sense in itself, how
275+
// TODO(bartomieju): surrogate half, doesn't make sense in itself, how
275276
// to determine in JS?
276277
// ["%c", 0xDC80, "�"],
277278
["%c", 0x110000, "�"],
278279
["%c", 0xfffffffff, "�"],
279-
// TODO
280+
// TODO(bartlomieju):
280281
// escaped characters
281282
// Runes that are not printable.
282283
// Runes that are not valid.
@@ -291,7 +292,8 @@ const tests: Array<[string, any, string]> = [
291292
["%.0s", "日本語日本語", ""],
292293
["%.5s", "日本語日本語", "日本語日本"],
293294
["%.10s", "日本語日本語", "日本語日本語"],
294-
// ["%08q", "abc", `000"abc"`], // TODO verb q
295+
// ["%08q", "abc", `000"abc"`],
296+
// TODO(bartlomieju): verb q
295297
// ["%-8q", "abc", `"abc" `],
296298
//["%.5q", "abcdefghijklmnopqrstuvwxyz", `"abcde"`],
297299
["%.5x", "abcdefghijklmnopqrstuvwxyz", "6162636465"],
@@ -301,7 +303,8 @@ const tests: Array<[string, any, string]> = [
301303
// our %x takes lower byte of string "%.1x", "日本語", "e6"],,
302304
["%.1x", "日本語", "e5"],
303305
//["%10.1q", "日本語日本語", ` "日"`],
304-
// ["%10v", null, " <nil>"], // TODO null, undefined ...
306+
// ["%10v", null, " <nil>"],
307+
// TODO(bartlomieju): null, undefined ...
305308
// ["%-10v", null, "<nil> "],
306309

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

359364
// floats
360365
["%+.3e", 0.0, "+0.000e+00"],
@@ -490,10 +495,11 @@ const tests: Array<[string, any, string]> = [
490495
["%g", 1.23456789e-3, "0.00123457"], // see above prec6 = precdef6 - (-3+1)
491496
//["%g", 1.23456789e20, "1.23456789e+20"],
492497
["%g", 1.23456789e20, "1.23457e+20"],
493-
// arrays // TODO
498+
// arrays
499+
// TODO(bartlomieju):
494500
// slice : go specific
495501

496-
// TODO decide how to handle deeper types, arrays, objects
502+
// TODO(bartlomieju): decide how to handle deeper types, arrays, objects
497503
// byte arrays and slices with %b,%c,%d,%o,%U and %v
498504
// f.space should and f.plus should not have an effect with %v.
499505
// f.space and f.plus should have an effect with %d.

std/fs/copy_test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ testCopySync(
327327

328328
assert(destStatInfo.atime instanceof Date);
329329
assert(destStatInfo.mtime instanceof Date);
330-
// TODO: Activate test when https://github.com/denoland/deno/issues/2411
330+
// TODO(bartlomieju): Activate test when https://github.com/denoland/deno/issues/2411
331331
// is fixed
332332
// assertEquals(destStatInfo.atime, srcStatInfo.atime);
333333
// assertEquals(destStatInfo.mtime, srcStatInfo.mtime);

std/fs/expand_glob.ts

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ interface SplitPath {
3232
winRoot?: string;
3333
}
3434

35-
// TODO: Maybe make this public somewhere.
3635
function split(path: string): SplitPath {
3736
const s = SEP_PATTERN.source;
3837
const segments = path

std/http/_io.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export function chunkedBodyReader(h: Headers, r: BufReader): Deno.Reader {
6565
}
6666
const line = await tp.readLine();
6767
if (line === null) throw new Deno.errors.UnexpectedEof();
68-
// TODO: handle chunk extension
68+
// TODO(bartlomieju): handle chunk extension
6969
const [chunkSizeString] = line.split(";");
7070
const chunkSize = parseInt(chunkSizeString, 16);
7171
if (Number.isNaN(chunkSize) || chunkSize < 0) {

std/http/cookie.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ export function setCookie(res: { headers?: Headers }, cookie: Cookie): void {
178178
if (!res.headers) {
179179
res.headers = new Headers();
180180
}
181-
// TODO (zekth) : Add proper parsing of Set-Cookie headers
181+
// TODO(zekth) : Add proper parsing of Set-Cookie headers
182182
// Parsing cookie headers to make consistent set-cookie header
183183
// ref: https://tools.ietf.org/html/rfc6265#section-4.1.1
184184
const v = toString(cookie);

std/http/file_server.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
33

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

99
import { extname, posix } from "../path/mod.ts";
@@ -141,7 +141,7 @@ export async function serveFile(
141141
};
142142
}
143143

144-
// TODO: simplify this after deno.stat and deno.readDir are fixed
144+
// TODO(bartlomieju): simplify this after deno.stat and deno.readDir are fixed
145145
async function serveDir(
146146
req: ServerRequest,
147147
dirPath: string,

std/http/file_server_test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ Deno.test("serveDirectory", async function (): Promise<void> {
201201
assert(page.includes("README.md"));
202202

203203
// `Deno.FileInfo` is not completely compatible with Windows yet
204-
// TODO: `mode` should work correctly in the future.
204+
// TODO(bartlomieju): `mode` should work correctly in the future.
205205
// Correct this test case accordingly.
206206
Deno.build.os !== "windows" &&
207207
assert(/<td class="mode">(\s)*\([a-zA-Z-]{10}\)(\s)*<\/td>/.test(page));

std/io/bufio_test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const readMakers: ReadMaker[] = [
5555
fn: (r): iotest.OneByteReader => new iotest.OneByteReader(r),
5656
},
5757
{ name: "half", fn: (r): iotest.HalfReader => new iotest.HalfReader(r) },
58-
// TODO { name: "data+err", r => new iotest.DataErrReader(r) },
58+
// TODO(bartlomieju): { name: "data+err", r => new iotest.DataErrReader(r) },
5959
// { name: "timeout", fn: r => new iotest.TimeoutReader(r) },
6060
];
6161

std/mime/multipart_test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ Deno.test({
236236
assert(file.tempfile != null);
237237
assertEquals(file.size, size);
238238
assertEquals(file.type, "application/octet-stream");
239-
// TODO checksum of tmp & sampleFile
239+
// TODO(bartlomieju): checksum of tmp & sampleFile
240240
} finally {
241241
await Deno.remove(multipartFile);
242242
await Deno.remove(sampleFile);

std/node/_fs/_fs_access.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { notImplemented } from "../_utils.ts";
44

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

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

17-
//TODO - 'path' can also be a Buffer. Neither of these polyfills
18-
//is available yet. See https://github.com/denoland/deno/issues/3403
17+
// TODO(bartlomieju) 'path' can also be a Buffer. Neither of these polyfills
18+
// is available yet. See https://github.com/denoland/deno/issues/3403
1919
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2020
export function accessSync(path: string | URL, mode?: number): void {
2121
notImplemented("Not yet available");

std/node/_fs/_fs_appendFile.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function appendFile(
4545
: undefined;
4646

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

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

std/node/global_test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import timers from "./timers.ts";
77
// Definitions for this are quite delicate
88
// This ensures modifications to the global namespace don't break on TypeScript
99

10-
// TODO
10+
// TODO(bartlomieju):
1111
// Deno lint marks globals defined by this module as undefined
1212
// probably gonna change in the future
1313

0 commit comments

Comments
 (0)