-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gracefully handle invalid paths csv regex in conf/args
Fix 'ignore-paths', in particular, but others using this function too. Closes #9680 (cherry picked from commit 3f1f7b8)
- Loading branch information
1 parent
c3e2579
commit 37e9772
Showing
4 changed files
with
11 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
Impossible to compile regexes for paths in the configuration or argument given to pylint won't crash anymore but | ||
raise an argparse error and display the error message from ``re.compile`` instead. | ||
|
||
Closes #9680 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
tests/config/functional/toml/issue_9680/bad_regex_in_ignore_paths.32.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
usage: pylint [options] | ||
pylint: error: argument --ignore-paths: Error in provided regular expression: project\\tooling_context\\**|project/tooling_context/** beginning at index 27: multiple repeat |
3 changes: 3 additions & 0 deletions
3
tests/config/functional/toml/issue_9680/bad_regex_in_ignore_paths.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Check that we report regex error in configuration file properly | ||
[tool.pylint."main"] | ||
ignore-paths = ['project/tooling_context/**'] |