From b5f0a407b2c7bb8c5ee06a13d20844a6285893b3 Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Mon, 2 Jan 2023 09:24:56 +0100 Subject: [PATCH] Introduce comment-tags setting (and make E501 skip them) It's quite common for TODO comments to be longer than line-length so that you can quickly display them in full with `git grep TODO`. Previously the ERA001 (CommentedOutCode) lint already hardcoded TODO|FIXME|XXX within a regular expression to skip such comments. This commit introduces a new comment-tags setting to make the comment tags that should be skipped by lints configurable and adapts the E501 (LineTooLong) lint to respect that new setting. --- README.md | 18 ++ flake8_to_ruff/src/converter.rs | 7 + resources/test/fixtures/pycodestyle/E501.py | 5 + ruff.schema.json | 10 + src/checkers/lines.rs | 4 +- src/eradicate/checks.rs | 2 +- src/eradicate/detection.rs | 192 +++++++++++--------- src/lib_wasm.rs | 1 + src/pycodestyle/checks.rs | 16 +- src/settings/configuration.rs | 3 + src/settings/mod.rs | 6 + src/settings/options.rs | 8 + src/settings/pyproject.rs | 6 + 13 files changed, 190 insertions(+), 88 deletions(-) diff --git a/README.md b/README.md index f74dafab452360..44b23cb2aba515 100644 --- a/README.md +++ b/README.md @@ -1726,6 +1726,24 @@ cache-dir = "~/.cache/ruff" --- +#### [`comment-tags`](#comment-tags) + +A list of comment tags to recognize (e.g. TODO, FIXME, XXX). +Comments starting with these tags will be skipped by E501 and ERA001. + +**Default value**: `["TODO", "FIXME", "XXX"]` + +**Type**: `Vec` + +**Example usage**: + +```toml +[tool.ruff] +comment-tags = ["TODO", "FIXME", "HACK"] +``` + +--- + #### [`dummy-variable-rgx`](#dummy-variable-rgx) A regular expression used to identify "dummy" variables, or those which diff --git a/flake8_to_ruff/src/converter.rs b/flake8_to_ruff/src/converter.rs index fd848eed9a903b..af007ff2ddc418 100644 --- a/flake8_to_ruff/src/converter.rs +++ b/flake8_to_ruff/src/converter.rs @@ -324,6 +324,7 @@ mod tests { src: None, target_version: None, unfixable: None, + comment_tags: None, update_check: None, flake8_annotations: None, flake8_bugbear: None, @@ -383,6 +384,7 @@ mod tests { src: None, target_version: None, unfixable: None, + comment_tags: None, update_check: None, flake8_annotations: None, flake8_bugbear: None, @@ -442,6 +444,7 @@ mod tests { src: None, target_version: None, unfixable: None, + comment_tags: None, update_check: None, flake8_annotations: None, flake8_bugbear: None, @@ -501,6 +504,7 @@ mod tests { src: None, target_version: None, unfixable: None, + comment_tags: None, update_check: None, flake8_annotations: None, flake8_bugbear: None, @@ -560,6 +564,7 @@ mod tests { src: None, target_version: None, unfixable: None, + comment_tags: None, update_check: None, flake8_annotations: None, flake8_bugbear: None, @@ -663,6 +668,7 @@ mod tests { src: None, target_version: None, unfixable: None, + comment_tags: None, update_check: None, flake8_annotations: None, flake8_bugbear: None, @@ -725,6 +731,7 @@ mod tests { src: None, target_version: None, unfixable: None, + comment_tags: None, update_check: None, flake8_annotations: None, flake8_bugbear: None, diff --git a/resources/test/fixtures/pycodestyle/E501.py b/resources/test/fixtures/pycodestyle/E501.py index 9126b341ab7307..0d79fa829e6f89 100644 --- a/resources/test/fixtures/pycodestyle/E501.py +++ b/resources/test/fixtures/pycodestyle/E501.py @@ -60,3 +60,8 @@ def caller(string: str) -> None: _ = """ Source: https://github.com/PyCQA/pycodestyle/pull/258/files#diff-841c622497a8033d10152bfdfb15b20b92437ecdea21a260944ea86b77b51533 """ + +# OK +# TODO: comments starting with one of the configured comment-tags may be longer than line-length so that you can easily find them with `git grep` +# TODO comments starting with one of the configured comment-tags may be longer than line-length so that you can easily find them with `git grep` +# TODO comments starting with one of the configured comment-tags may be longer than line-length so that you can easily find them with `git grep` diff --git a/ruff.schema.json b/ruff.schema.json index 9ff5639a49708a..0355d64728f31b 100644 --- a/ruff.schema.json +++ b/ruff.schema.json @@ -22,6 +22,16 @@ "null" ] }, + "comment-tags": { + "description": "A list of comment tags to recognize (e.g. TODO, FIXME, XXX). Comments starting with these tags will be skipped by E501 and ERA001.", + "type": [ + "array", + "null" + ], + "items": { + "type": "string" + } + }, "dummy-variable-rgx": { "description": "A regular expression used to identify \"dummy\" variables, or those which should be ignored when evaluating (e.g.) unused-variable checks. The default expression matches `_`, `__`, and `_var`, but not `_var_`.", "type": [ diff --git a/src/checkers/lines.rs b/src/checkers/lines.rs index eebc67993ae148..59ea668ac853ab 100644 --- a/src/checkers/lines.rs +++ b/src/checkers/lines.rs @@ -57,7 +57,9 @@ pub fn check_lines( } if enforce_line_too_long { - if let Some(check) = line_too_long(index, line, settings.line_length) { + if let Some(check) = + line_too_long(index, line, settings.line_length, &settings.comment_tags) + { checks.push(check); } } diff --git a/src/eradicate/checks.rs b/src/eradicate/checks.rs index dff4cda8d9b004..333015aa8891b3 100644 --- a/src/eradicate/checks.rs +++ b/src/eradicate/checks.rs @@ -31,7 +31,7 @@ pub fn commented_out_code( let line = locator.slice_source_code_range(&Range::new(location, end_location)); // Verify that the comment is on its own line, and that it contains code. - if is_standalone_comment(&line) && comment_contains_code(&line) { + if is_standalone_comment(&line) && comment_contains_code(&line, &settings.comment_tags[..]) { let mut check = Check::new(CheckKind::CommentedOutCode, Range::new(start, end)); if matches!(autofix, flags::Autofix::Enabled) && settings.fixable.contains(&CheckCode::ERA001) diff --git a/src/eradicate/detection.rs b/src/eradicate/detection.rs index ad1b2c2bc91d36..01f514d1e56e4e 100644 --- a/src/eradicate/detection.rs +++ b/src/eradicate/detection.rs @@ -4,7 +4,7 @@ use regex::Regex; static ALLOWLIST_REGEX: Lazy = Lazy::new(|| { Regex::new( - r"^(?i)(?:pylint|pyright|noqa|nosec|type:\s*ignore|fmt:\s*(on|off)|isort:\s*(on|off|skip|skip_file|split|dont-add-imports(:\s*\[.*?])?)|TODO|FIXME|XXX)" + r"^(?i)(?:pylint|pyright|noqa|nosec|type:\s*ignore|fmt:\s*(on|off)|isort:\s*(on|off|skip|skip_file|split|dont-add-imports(:\s*\[.*?])?))" ).unwrap() }); static BRACKET_REGEX: Lazy = Lazy::new(|| Regex::new(r"^[()\[\]{}\s]+$").unwrap()); @@ -30,7 +30,7 @@ static PARTIAL_DICTIONARY_REGEX: Lazy = static PRINT_RETURN_REGEX: Lazy = Lazy::new(|| Regex::new(r"^(print|return)\b\s*").unwrap()); /// Returns `true` if a comment contains Python code. -pub fn comment_contains_code(line: &str) -> bool { +pub fn comment_contains_code(line: &str, comment_tags: &[String]) -> bool { let line = if let Some(line) = line.trim().strip_prefix('#') { line.trim() } else { @@ -47,6 +47,12 @@ pub fn comment_contains_code(line: &str) -> bool { return false; } + if let Some(first) = line.split(&[' ', ':']).next() { + if comment_tags.iter().any(|tag| tag == first) { + return false; + } + } + if CODING_COMMENT_REGEX.is_match(line) { return false; } @@ -97,127 +103,147 @@ mod tests { #[test] fn comment_contains_code_basic() { - assert!(comment_contains_code("# x = 1")); - assert!(comment_contains_code("#from foo import eradicate")); - assert!(comment_contains_code("#import eradicate")); - assert!(comment_contains_code(r#"#"key": value,"#)); - assert!(comment_contains_code(r#"#"key": "value","#)); - assert!(comment_contains_code(r#"#"key": 1 + 1,"#)); - assert!(comment_contains_code("#'key': 1 + 1,")); - assert!(comment_contains_code(r#"#"key": {"#)); - assert!(comment_contains_code("#}")); - assert!(comment_contains_code("#} )]")); - - assert!(!comment_contains_code("#")); - assert!(!comment_contains_code("# This is a (real) comment.")); - assert!(!comment_contains_code("# 123")); - assert!(!comment_contains_code("# 123.1")); - assert!(!comment_contains_code("# 1, 2, 3")); - assert!(!comment_contains_code("x = 1 # x = 1")); + assert!(comment_contains_code("# x = 1", &[])); + assert!(comment_contains_code("#from foo import eradicate", &[])); + assert!(comment_contains_code("#import eradicate", &[])); + assert!(comment_contains_code(r#"#"key": value,"#, &[])); + assert!(comment_contains_code(r#"#"key": "value","#, &[])); + assert!(comment_contains_code(r#"#"key": 1 + 1,"#, &[])); + assert!(comment_contains_code("#'key': 1 + 1,", &[])); + assert!(comment_contains_code(r#"#"key": {"#, &[])); + assert!(comment_contains_code("#}", &[])); + assert!(comment_contains_code("#} )]", &[])); + + assert!(!comment_contains_code("#", &[])); + assert!(!comment_contains_code("# This is a (real) comment.", &[])); + assert!(!comment_contains_code("# 123", &[])); + assert!(!comment_contains_code("# 123.1", &[])); + assert!(!comment_contains_code("# 1, 2, 3", &[])); + assert!(!comment_contains_code("x = 1 # x = 1", &[])); + assert!(!comment_contains_code( + "# pylint: disable=redefined-outer-name", + &[] + ),); assert!(!comment_contains_code( - "# pylint: disable=redefined-outer-name" + "# Issue #999: This is not code", + &[] )); - assert!(!comment_contains_code("# Issue #999: This is not code")); // TODO(charlie): This should be `true` under aggressive mode. - assert!(!comment_contains_code("#},")); + assert!(!comment_contains_code("#},", &[])); } #[test] fn comment_contains_code_with_print() { - assert!(comment_contains_code("#print")); - assert!(comment_contains_code("#print(1)")); - assert!(comment_contains_code("#print 1")); + assert!(comment_contains_code("#print", &[])); + assert!(comment_contains_code("#print(1)", &[])); + assert!(comment_contains_code("#print 1", &[])); - assert!(!comment_contains_code("#to print")); + assert!(!comment_contains_code("#to print", &[])); } #[test] fn comment_contains_code_with_return() { - assert!(comment_contains_code("#return x")); + assert!(comment_contains_code("#return x", &[])); - assert!(!comment_contains_code("#to print")); + assert!(!comment_contains_code("#to print", &[])); } #[test] fn comment_contains_code_with_multiline() { - assert!(comment_contains_code("#else:")); - assert!(comment_contains_code("# else : ")); - assert!(comment_contains_code(r#"# "foo %d" % \\"#)); - assert!(comment_contains_code("#elif True:")); - assert!(comment_contains_code("#x = foo(")); - assert!(comment_contains_code("#except Exception:")); - - assert!(!comment_contains_code("# this is = to that :(")); - assert!(!comment_contains_code("#else")); - assert!(!comment_contains_code("#or else:")); - assert!(!comment_contains_code("#else True:")); + assert!(comment_contains_code("#else:", &[])); + assert!(comment_contains_code("# else : ", &[])); + assert!(comment_contains_code(r#"# "foo %d" % \\"#, &[])); + assert!(comment_contains_code("#elif True:", &[])); + assert!(comment_contains_code("#x = foo(", &[])); + assert!(comment_contains_code("#except Exception:", &[])); + + assert!(!comment_contains_code("# this is = to that :(", &[])); + assert!(!comment_contains_code("#else", &[])); + assert!(!comment_contains_code("#or else:", &[])); + assert!(!comment_contains_code("#else True:", &[])); // TODO(charlie): This should be `true` under aggressive mode. - assert!(!comment_contains_code("#def foo():")); + assert!(!comment_contains_code("#def foo():", &[])); } #[test] fn comment_contains_code_with_sentences() { - assert!(!comment_contains_code("#code is good")); + assert!(!comment_contains_code("#code is good", &[])); } #[test] fn comment_contains_code_with_encoding() { - assert!(comment_contains_code("# codings=utf-8")); + assert!(comment_contains_code("# codings=utf-8", &[])); - assert!(!comment_contains_code("# coding=utf-8")); - assert!(!comment_contains_code("#coding= utf-8")); - assert!(!comment_contains_code("# coding: utf-8")); - assert!(!comment_contains_code("# encoding: utf8")); + assert!(!comment_contains_code("# coding=utf-8", &[])); + assert!(!comment_contains_code("#coding= utf-8", &[])); + assert!(!comment_contains_code("# coding: utf-8", &[])); + assert!(!comment_contains_code("# encoding: utf8", &[])); } #[test] fn comment_contains_code_with_default_allowlist() { - assert!(!comment_contains_code("# pylint: disable=A0123")); - assert!(!comment_contains_code("# pylint:disable=A0123")); - assert!(!comment_contains_code("# pylint: disable = A0123")); - assert!(!comment_contains_code("# pylint:disable = A0123")); - assert!(!comment_contains_code("# pyright: reportErrorName=true")); - assert!(!comment_contains_code("# noqa")); - assert!(!comment_contains_code("# NOQA")); - assert!(!comment_contains_code("# noqa: A123")); - assert!(!comment_contains_code("# noqa:A123")); - assert!(!comment_contains_code("# nosec")); - assert!(!comment_contains_code("# fmt: on")); - assert!(!comment_contains_code("# fmt: off")); - assert!(!comment_contains_code("# fmt:on")); - assert!(!comment_contains_code("# fmt:off")); - assert!(!comment_contains_code("# isort: on")); - assert!(!comment_contains_code("# isort:on")); - assert!(!comment_contains_code("# isort: off")); - assert!(!comment_contains_code("# isort:off")); - assert!(!comment_contains_code("# isort: skip")); - assert!(!comment_contains_code("# isort:skip")); - assert!(!comment_contains_code("# isort: skip_file")); - assert!(!comment_contains_code("# isort:skip_file")); - assert!(!comment_contains_code("# isort: split")); - assert!(!comment_contains_code("# isort:split")); - assert!(!comment_contains_code("# isort: dont-add-imports")); - assert!(!comment_contains_code("# isort:dont-add-imports")); + assert!(!comment_contains_code("# pylint: disable=A0123", &[])); + assert!(!comment_contains_code("# pylint:disable=A0123", &[])); + assert!(!comment_contains_code("# pylint: disable = A0123", &[])); + assert!(!comment_contains_code("# pylint:disable = A0123", &[])); + assert!(!comment_contains_code( + "# pyright: reportErrorName=true", + &[] + )); + assert!(!comment_contains_code("# noqa", &[])); + assert!(!comment_contains_code("# NOQA", &[])); + assert!(!comment_contains_code("# noqa: A123", &[])); + assert!(!comment_contains_code("# noqa:A123", &[])); + assert!(!comment_contains_code("# nosec", &[])); + assert!(!comment_contains_code("# fmt: on", &[])); + assert!(!comment_contains_code("# fmt: off", &[])); + assert!(!comment_contains_code("# fmt:on", &[])); + assert!(!comment_contains_code("# fmt:off", &[])); + assert!(!comment_contains_code("# isort: on", &[])); + assert!(!comment_contains_code("# isort:on", &[])); + assert!(!comment_contains_code("# isort: off", &[])); + assert!(!comment_contains_code("# isort:off", &[])); + assert!(!comment_contains_code("# isort: skip", &[])); + assert!(!comment_contains_code("# isort:skip", &[])); + assert!(!comment_contains_code("# isort: skip_file", &[])); + assert!(!comment_contains_code("# isort:skip_file", &[])); + assert!(!comment_contains_code("# isort: split", &[])); + assert!(!comment_contains_code("# isort:split", &[])); + assert!(!comment_contains_code("# isort: dont-add-imports", &[])); + assert!(!comment_contains_code("# isort:dont-add-imports", &[])); + assert!(!comment_contains_code( + "# isort: dont-add-imports: [\"import os\"]", + &[] + )); + assert!(!comment_contains_code( + "# isort:dont-add-imports: [\"import os\"]", + &[] + )); + assert!(!comment_contains_code( + "# isort: dont-add-imports:[\"import os\"]", + &[] + )); assert!(!comment_contains_code( - "# isort: dont-add-imports: [\"import os\"]" + "# isort:dont-add-imports:[\"import os\"]", + &[] )); + assert!(!comment_contains_code("# type: ignore", &[])); + assert!(!comment_contains_code("# type:ignore", &[])); + assert!(!comment_contains_code("# type: ignore[import]", &[])); + assert!(!comment_contains_code("# type:ignore[import]", &[])); assert!(!comment_contains_code( - "# isort:dont-add-imports: [\"import os\"]" + "# TODO: Do that", + &["TODO".to_string()] )); assert!(!comment_contains_code( - "# isort: dont-add-imports:[\"import os\"]" + "# FIXME: Fix that", + &["FIXME".to_string()] )); assert!(!comment_contains_code( - "# isort:dont-add-imports:[\"import os\"]" + "# XXX: What ever", + &["XXX".to_string()] )); - assert!(!comment_contains_code("# type: ignore")); - assert!(!comment_contains_code("# type:ignore")); - assert!(!comment_contains_code("# type: ignore[import]")); - assert!(!comment_contains_code("# type:ignore[import]")); - assert!(!comment_contains_code("# TODO: Do that")); - assert!(!comment_contains_code("# FIXME: Fix that")); - assert!(!comment_contains_code("# XXX: What ever")); } } diff --git a/src/lib_wasm.rs b/src/lib_wasm.rs index 1e5600beaea449..193c1d20f627bf 100644 --- a/src/lib_wasm.rs +++ b/src/lib_wasm.rs @@ -112,6 +112,7 @@ pub fn defaultSettings() -> Result { show_source: None, src: None, unfixable: None, + comment_tags: None, update_check: None, // Use default options for all plugins. flake8_annotations: Some(flake8_annotations::settings::Settings::default().into()), diff --git a/src/pycodestyle/checks.rs b/src/pycodestyle/checks.rs index fca3b4f8a23709..8644a2d306f43b 100644 --- a/src/pycodestyle/checks.rs +++ b/src/pycodestyle/checks.rs @@ -13,7 +13,12 @@ use crate::source_code_locator::SourceCodeLocator; static URL_REGEX: Lazy = Lazy::new(|| Regex::new(r"^https?://\S+$").unwrap()); /// E501 -pub fn line_too_long(lineno: usize, line: &str, max_line_length: usize) -> Option { +pub fn line_too_long( + lineno: usize, + line: &str, + max_line_length: usize, + comment_tags: &[String], +) -> Option { let line_length = line.chars().count(); if line_length <= max_line_length { @@ -21,14 +26,19 @@ pub fn line_too_long(lineno: usize, line: &str, max_line_length: usize) -> Optio } let mut chunks = line.split_whitespace(); - let (Some(first), Some(_)) = (chunks.next(), chunks.next()) else { + let (Some(first), Some(second)) = (chunks.next(), chunks.next()) else { // Single word / no printable chars - no way to make the line shorter return None; }; + let second = second.trim_end_matches(':'); + // Do not enforce the line length for commented lines that end with a URL // or contain only a single word. - if first == "#" && chunks.last().map_or(true, |c| URL_REGEX.is_match(c)) { + if first == "#" + && (comment_tags.iter().any(|tag| tag == second) + || chunks.last().map_or(true, |c| URL_REGEX.is_match(c))) + { return None; } diff --git a/src/settings/configuration.rs b/src/settings/configuration.rs index bb6406131b0018..6c869a08ce143d 100644 --- a/src/settings/configuration.rs +++ b/src/settings/configuration.rs @@ -53,6 +53,7 @@ pub struct Configuration { pub target_version: Option, pub unfixable: Option>, pub update_check: Option, + pub comment_tags: Option>, // Plugins pub flake8_annotations: Option, pub flake8_bugbear: Option, @@ -148,6 +149,7 @@ impl Configuration { .transpose()?, target_version: options.target_version, unfixable: options.unfixable, + comment_tags: options.comment_tags, update_check: options.update_check, // Plugins flake8_annotations: options.flake8_annotations, @@ -207,6 +209,7 @@ impl Configuration { src: self.src.or(config.src), target_version: self.target_version.or(config.target_version), unfixable: self.unfixable.or(config.unfixable), + comment_tags: self.comment_tags.or(config.comment_tags), update_check: self.update_check.or(config.update_check), // Plugins flake8_annotations: self.flake8_annotations.or(config.flake8_annotations), diff --git a/src/settings/mod.rs b/src/settings/mod.rs index e8caea6d178d70..add8bb9538251f 100644 --- a/src/settings/mod.rs +++ b/src/settings/mod.rs @@ -58,6 +58,7 @@ pub struct Settings { pub show_source: bool, pub src: Vec, pub target_version: PythonVersion, + pub comment_tags: Vec, pub update_check: bool, // Plugins pub flake8_annotations: flake8_annotations::settings::Settings, @@ -154,6 +155,9 @@ impl Settings { .src .unwrap_or_else(|| vec![project_root.to_path_buf()]), target_version: config.target_version.unwrap_or_default(), + comment_tags: config.comment_tags.unwrap_or_else(|| { + vec!["TODO".to_string(), "FIXME".to_string(), "XXX".to_string()] + }), update_check: config.update_check.unwrap_or(true), // Plugins flake8_annotations: config @@ -229,6 +233,7 @@ impl Settings { show_source: false, src: vec![path_dedot::CWD.clone()], target_version: PythonVersion::Py310, + comment_tags: vec!["TODO".to_string()], update_check: false, flake8_annotations: flake8_annotations::settings::Settings::default(), flake8_bugbear: flake8_bugbear::settings::Settings::default(), @@ -267,6 +272,7 @@ impl Settings { show_source: false, src: vec![path_dedot::CWD.clone()], target_version: PythonVersion::Py310, + comment_tags: vec!["TODO".to_string()], update_check: false, flake8_annotations: flake8_annotations::settings::Settings::default(), flake8_bugbear: flake8_bugbear::settings::Settings::default(), diff --git a/src/settings/options.rs b/src/settings/options.rs index 487f6fc4339c0f..e0ec71d73a3242 100644 --- a/src/settings/options.rs +++ b/src/settings/options.rs @@ -339,6 +339,14 @@ pub struct Options { )] /// A list of check code prefixes to consider un-autofix-able. pub unfixable: Option>, + #[option( + default = r#"["TODO", "FIXME", "XXX"]"#, + value_type = "Vec", + example = r#"comment-tags = ["TODO", "FIXME", "HACK"]"# + )] + /// A list of comment tags to recognize (e.g. TODO, FIXME, XXX). + /// Comments starting with these tags will be skipped by E501 and ERA001. + pub comment_tags: Option>, #[option( default = "true", value_type = "bool", diff --git a/src/settings/pyproject.rs b/src/settings/pyproject.rs index bbdb2456378fd5..6b5781af4bbcbc 100644 --- a/src/settings/pyproject.rs +++ b/src/settings/pyproject.rs @@ -188,6 +188,7 @@ mod tests { src: None, target_version: None, unfixable: None, + comment_tags: None, update_check: None, flake8_annotations: None, flake8_bugbear: None, @@ -240,6 +241,7 @@ line-length = 79 src: None, target_version: None, unfixable: None, + comment_tags: None, update_check: None, cache_dir: None, flake8_annotations: None, @@ -294,6 +296,7 @@ exclude = ["foo.py"] src: None, target_version: None, unfixable: None, + comment_tags: None, update_check: None, flake8_annotations: None, flake8_errmsg: None, @@ -347,6 +350,7 @@ select = ["E501"] src: None, target_version: None, unfixable: None, + comment_tags: None, update_check: None, flake8_annotations: None, flake8_bugbear: None, @@ -401,6 +405,7 @@ ignore = ["E501"] src: None, target_version: None, unfixable: None, + comment_tags: None, update_check: None, flake8_annotations: None, flake8_bugbear: None, @@ -485,6 +490,7 @@ other-attribute = 1 format: None, force_exclude: None, unfixable: None, + comment_tags: None, update_check: None, cache_dir: None, per_file_ignores: Some(FxHashMap::from_iter([(