Skip to content

Commit 9cbc977

Browse files
committed
fix: Rewrite :: section
1 parent 330782a commit 9cbc977

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

text/3389-manifest-lint.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -235,16 +235,18 @@ chose `lint` being the keys because
235235

236236
## Linter Tables vs Linter Namespaces
237237

238-
Instead of `<tool>.<lint>`, we could use `<tool>::<lint>` (e.g.
239-
`"clipp::enum_glob_use"` instead of `clippy.enum_glob_use`), like in the
240-
diagnostic messages. This would make it easier to copy/paste lint names.
241-
However, with the schema being `<lint> = <level>`, this would require quoting
242-
the keys rather than leaving them as bare words. This might also cause
243-
problems for tool-level configuration. The first is that the lints wouldn't be
244-
easily grouped with their tool's config. The second is if we use `lints.<lint> = <level>`
245-
and tool-level configuration goes under `lints.<tool>`,
246-
then keys under `[lints]` are ambiguous as to whether they are a tool or a
247-
lint, making it harder to collect all lints to forward tools.
238+
We started off with lints being referenced with their tool as a namespace (e.g.
239+
`"clipp::enum_glob_use"`) like in diagnostic messages, making copy/paste easy.
240+
241+
However, we switched to a more hierarchical data model (e.g.
242+
`clippy.enum_glob_use`) to avoid quoting keys with the `lints.<lint> = <level>` schema.
243+
244+
If we add lint/linter config in the future
245+
- Being more hierarchical means lint and linter config are kept closer to each
246+
other, making it easier to evaluate their impact on each other.
247+
- `lints.<lint> = <level>` combined with `lints.<linter>.metadata` makes it
248+
harder for cargo to collect all the lints to pass down into the compiler
249+
driver.
248250

249251
## Lint Precedence
250252

0 commit comments

Comments
 (0)