diff options
author | Jakub Kuczys <me@jacken.men> | 2022-11-13 12:41:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-13 11:41:38 +0000 |
commit | ac65bdc0741379c3f2ac964626b31db93d49bf1e (patch) | |
tree | 265762220933cf40e60cac448e95b5fc73e231aa /examples | |
parent | 88701fab1a87e57c3f5c42dda95c51915022ba51 (diff) | |
download | pylint-git-ac65bdc0741379c3f2ac964626b31db93d49bf1e.tar.gz |
Use qualified name when checking for overgeneral exceptions (#7497)
* Update tests
* Use qualified name when checking for overgeneral exceptions
* WIP: Add deprecation warning
* Add changelog fragment
* Use qualified name in test case
* spell check fix
* Update changelog fragment with suggested fixes
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
* Move OVERGENERAL_EXCEPTIONS directly to the default value in dict
* Mark as TODO for pylint 3.0
* Properly warn on each occurrence of name without dots
* Update the warning per the review
* Rephrase the warning to mention pylint 3.0
* Remove unnecessary nesting of the if condition
* Quote the exception name in deprecation warning
* Use config value for overgeneral exceptions in broad-exception-raised
* Infer qualified name of the exception in broad-exception-raised
* e.g. -> maybe?
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Suppress missing class docstrings
* Add few more tests for broad-exception-raised
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
* Fix unexpected missing-raise-from
* Revert "Fix unexpected missing-raise-from"
This reverts commit d796e72035b7f7578b9e6bb1e45a30935e80b009.
* Revert "Add few more tests for broad-exception-raised"
This reverts commit e5a193ee136f8566d43450fbb9fbf28cc717d307.
* Change confidence of broad-exception-raised from HIGH to INFERENCE
* Only trigger broad-exception-raised for raise with new exc instance
* Update overgeneral-exceptions definition in example pylintrc file
* Update pylint/checkers/exceptions.py
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Diffstat (limited to 'examples')
-rw-r--r-- | examples/pylintrc | 4 | ||||
-rw-r--r-- | examples/pyproject.toml | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/examples/pylintrc b/examples/pylintrc index a461b24d5..608a8f269 100644 --- a/examples/pylintrc +++ b/examples/pylintrc @@ -307,8 +307,8 @@ min-public-methods=2 [EXCEPTIONS] # Exceptions that will emit a warning when caught. -overgeneral-exceptions=BaseException, - Exception +overgeneral-exceptions=builtins.BaseException, + builtins.Exception [FORMAT] diff --git a/examples/pyproject.toml b/examples/pyproject.toml index b419f83e7..c02538a7c 100644 --- a/examples/pyproject.toml +++ b/examples/pyproject.toml @@ -264,7 +264,7 @@ min-public-methods = 2 [tool.pylint.exceptions] # Exceptions that will emit a warning when caught. -overgeneral-exceptions = ["BaseException", "Exception"] +overgeneral-exceptions = ["builtins.BaseException", "builtins.Exception"] [tool.pylint.format] # Expected format of line ending, e.g. empty (any line ending), LF or CRLF. |