summaryrefslogtreecommitdiff
path: root/pylint/lint
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2023-03-21 09:00:23 +0100
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2023-03-21 09:17:44 +0100
commit95a82dc7ef54070e31dcecf56f2ded5348e3dfb7 (patch)
tree8418c2e5fe83438729e27d46863899f66b2e9a56 /pylint/lint
parentd4a8b028d6b982e4756ab0daa7cbea137c296db7 (diff)
downloadpylint-git-95a82dc7ef54070e31dcecf56f2ded5348e3dfb7.tar.gz
Add explicit 'stack_level' keyword in Deprecation/User warnings
Diffstat (limited to 'pylint/lint')
-rw-r--r--pylint/lint/caching.py1
-rw-r--r--pylint/lint/run.py3
2 files changed, 4 insertions, 0 deletions
diff --git a/pylint/lint/caching.py b/pylint/lint/caching.py
index 8ea8a2236..feffac656 100644
--- a/pylint/lint/caching.py
+++ b/pylint/lint/caching.py
@@ -45,6 +45,7 @@ def load_results(
"You're using an old pylint cache with invalid data following "
f"an upgrade, please delete '{data_file}'.",
UserWarning,
+ stacklevel=2,
)
raise TypeError
return data
diff --git a/pylint/lint/run.py b/pylint/lint/run.py
index 49b807f87..7c2e8c0e6 100644
--- a/pylint/lint/run.py
+++ b/pylint/lint/run.py
@@ -175,6 +175,7 @@ group are mutually exclusive.",
warnings.warn(
"NOTE: The 'pylint-config' command is experimental and usage can change",
UserWarning,
+ stacklevel=2,
)
code = _handle_pylint_config_commands(linter)
if exit:
@@ -216,9 +217,11 @@ group are mutually exclusive.",
score_value = linter.generate_reports()
if do_exit is not UNUSED_PARAM_SENTINEL:
+ # TODO: 3.0
warnings.warn(
"do_exit is deprecated and it is going to be removed in a future version.",
DeprecationWarning,
+ stacklevel=2,
)
exit = do_exit