Commit 4208c19
enable the
Summary:
after connernilsen pointed out that i accidentally committed a `dbg!` macro, i wondered if there was a clippy rule to prevent such mistakes (see #4729 (comment)). turns out there is!
note that enabling a rule globally seems to be nowhere near as straightforward as it is in most other linters, so i had to make some other changes:
- i had to set `workspace = true` in each package (rust-lang/rust-clippy#16541 (comment))
- i also had to move the existing `unexpected_cfgs` config out of the individual packages into the global config, to workaround rust-lang/cargo#13157
Pull Request resolved: #4821
Test Plan:
intentionally inserted a `dbg!` macro and ran `cargo clippy`:
```
error: the `dbg!` macro is intended as a debugging tool
--> crates/pyrefly_config/src/migration/error_codes.rs:72:9
|
72 | dbg!(&pyright_cfg.type_checking_mode);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: for further information visit https://rust-lang.github.io/rust-clippy/rust-1.98.0/index.html#dbg_macro
= note: requested on the command line with `-D clippy::dbg-macro`
help: remove the invocation before committing it to a version control system
|
72 - dbg!(&pyright_cfg.type_checking_mode);
72 + &pyright_cfg.type_checking_mode;
|
error: could not compile `pyrefly_config` (lib) due to 1 previous error
```
Reviewed By: samwgoldman
Differential Revision: D118959745
Pulled By: stroxler
fbshipit-source-id: fca410967f9edfeb2defa2225a5cad4dd8962ea1dbg_macro clippy rule (#4821)1 parent ce6b61e commit 4208c19
14 files changed
Lines changed: 42 additions & 6 deletions
File tree
- crates
- pyrefly_bench_harness
- pyrefly_build
- pyrefly_bundled
- pyrefly_config
- pyrefly_derive
- pyrefly_glean_schema
- pyrefly_graph
- pyrefly_lsp_test
- pyrefly_python
- pyrefly_types
- pyrefly_util
- tsp_types
- pyrefly
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
0 commit comments