summaryrefslogtreecommitdiff
path: root/tests/config
diff options
context:
space:
mode:
authorPierre Sassoulas <pierre.sassoulas@gmail.com>2022-06-04 15:08:49 +0200
committerPierre Sassoulas <pierre.sassoulas@gmail.com>2022-06-06 10:38:35 +0200
commit92f28ce43cccdbdb8b41723e9ed86b2bbfaa2de3 (patch)
tree98f7242aa23d8d52437cb349a01215f3adbbc03c /tests/config
parentf8756edd025d9f4a88805feacb1a038e54840d02 (diff)
downloadpylint-git-92f28ce43cccdbdb8b41723e9ed86b2bbfaa2de3.tar.gz
[bad-option-value] Add a 'useless-option-value' message
So it's possible to to distinguish between genuine typoes and old configuration that could be cleaned. We use old_names to decrease message type to warning
Diffstat (limited to 'tests/config')
-rw-r--r--tests/config/functional/ini/pylintrc_with_deleted_message.2.out4
-rw-r--r--tests/config/functional/ini/pylintrc_with_deleted_message.8.out3
-rw-r--r--tests/config/functional/ini/pylintrc_with_deleted_message.result.json4
-rw-r--r--tests/config/functional/ini/pylintrc_with_missing_comma.2.out3
-rw-r--r--tests/config/functional/ini/pylintrc_with_missing_comma.4.out3
-rw-r--r--tests/config/functional/setup_cfg/do_not_read_other_tools_configuration/setup.2.out2
-rw-r--r--tests/config/functional/setup_cfg/do_not_read_other_tools_configuration/setup.4.out2
-rw-r--r--tests/config/functional/toml/issue_3122/toml_with_missing_comma.2.out3
-rw-r--r--tests/config/functional/toml/issue_3122/toml_with_missing_comma.4.out3
-rw-r--r--tests/config/functional/toml/unknown_msgid/enable_unknown_msgid.2.out3
-rw-r--r--tests/config/functional/toml/unknown_msgid/enable_unknown_msgid.4.out3
-rw-r--r--tests/config/test_config.py2
12 files changed, 17 insertions, 18 deletions
diff --git a/tests/config/functional/ini/pylintrc_with_deleted_message.2.out b/tests/config/functional/ini/pylintrc_with_deleted_message.2.out
deleted file mode 100644
index bbd33e9b8..000000000
--- a/tests/config/functional/ini/pylintrc_with_deleted_message.2.out
+++ /dev/null
@@ -1,4 +0,0 @@
-************* Module {abspath}
-{relpath}:1:0: E0012: Bad option value for '--disable', expected a valid pylint message and got 'buffer-builtin' (bad-option-value)
-{relpath}:1:0: E0012: Bad option value for '--enable', expected a valid pylint message and got 'useless-option-value' (bad-option-value)
-{relpath}:1:0: E0012: Bad option value for '--enable', expected a valid pylint message and got 'cmp-builtin' (bad-option-value)
diff --git a/tests/config/functional/ini/pylintrc_with_deleted_message.8.out b/tests/config/functional/ini/pylintrc_with_deleted_message.8.out
new file mode 100644
index 000000000..bb7bad8d9
--- /dev/null
+++ b/tests/config/functional/ini/pylintrc_with_deleted_message.8.out
@@ -0,0 +1,3 @@
+************* Module {abspath}
+{relpath}:1:0: R0022: Useless option value for '--disable', 'buffer-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
+{relpath}:1:0: R0022: Useless option value for '--enable', 'cmp-builtin' was removed from pylint, see https://github.com/PyCQA/pylint/pull/4942. (useless-option-value)
diff --git a/tests/config/functional/ini/pylintrc_with_deleted_message.result.json b/tests/config/functional/ini/pylintrc_with_deleted_message.result.json
index b41e71603..f804f10ec 100644
--- a/tests/config/functional/ini/pylintrc_with_deleted_message.result.json
+++ b/tests/config/functional/ini/pylintrc_with_deleted_message.result.json
@@ -1,10 +1,10 @@
{
"functional_append": {
"disable": ["logging-not-lazy"],
- "enable": ["locally-disabled"]
+ "enable": ["locally-disabled", "useless-option-value"]
},
"functional_remove": {
- "disable": ["locally-disabled"],
+ "disable": ["locally-disabled", "useless-option-value"],
"enable": ["logging-not-lazy"]
},
"jobs": 10,
diff --git a/tests/config/functional/ini/pylintrc_with_missing_comma.2.out b/tests/config/functional/ini/pylintrc_with_missing_comma.2.out
deleted file mode 100644
index 18078796e..000000000
--- a/tests/config/functional/ini/pylintrc_with_missing_comma.2.out
+++ /dev/null
@@ -1,3 +0,0 @@
-************* Module {abspath}
-{relpath}:1:0: E0012: Bad option value for '--disable', expected a valid pylint message and got 'logging-not-lazylogging-format-interpolation' (bad-option-value)
-{relpath}:1:0: E0012: Bad option value for '--enable', expected a valid pylint message and got 'locally-disabledsuppressed-message' (bad-option-value)
diff --git a/tests/config/functional/ini/pylintrc_with_missing_comma.4.out b/tests/config/functional/ini/pylintrc_with_missing_comma.4.out
new file mode 100644
index 000000000..a7b3fff66
--- /dev/null
+++ b/tests/config/functional/ini/pylintrc_with_missing_comma.4.out
@@ -0,0 +1,3 @@
+************* Module {abspath}
+{relpath}:1:0: W0012: Unknown option value for '--disable', expected a valid pylint message and got 'logging-not-lazylogging-format-interpolation' (unknown-option-value)
+{relpath}:1:0: W0012: Unknown option value for '--enable', expected a valid pylint message and got 'locally-disabledsuppressed-message' (unknown-option-value)
diff --git a/tests/config/functional/setup_cfg/do_not_read_other_tools_configuration/setup.2.out b/tests/config/functional/setup_cfg/do_not_read_other_tools_configuration/setup.2.out
deleted file mode 100644
index e7d49f428..000000000
--- a/tests/config/functional/setup_cfg/do_not_read_other_tools_configuration/setup.2.out
+++ /dev/null
@@ -1,2 +0,0 @@
-************* Module {abspath}
-{relpath}:1:0: E0012: Bad option value for '--enable', expected a valid pylint message and got 'useless-supression' (bad-option-value)
diff --git a/tests/config/functional/setup_cfg/do_not_read_other_tools_configuration/setup.4.out b/tests/config/functional/setup_cfg/do_not_read_other_tools_configuration/setup.4.out
new file mode 100644
index 000000000..cc4f7eb59
--- /dev/null
+++ b/tests/config/functional/setup_cfg/do_not_read_other_tools_configuration/setup.4.out
@@ -0,0 +1,2 @@
+************* Module {abspath}
+{relpath}:1:0: W0012: Unknown option value for '--enable', expected a valid pylint message and got 'useless-supression' (unknown-option-value)
diff --git a/tests/config/functional/toml/issue_3122/toml_with_missing_comma.2.out b/tests/config/functional/toml/issue_3122/toml_with_missing_comma.2.out
deleted file mode 100644
index 18078796e..000000000
--- a/tests/config/functional/toml/issue_3122/toml_with_missing_comma.2.out
+++ /dev/null
@@ -1,3 +0,0 @@
-************* Module {abspath}
-{relpath}:1:0: E0012: Bad option value for '--disable', expected a valid pylint message and got 'logging-not-lazylogging-format-interpolation' (bad-option-value)
-{relpath}:1:0: E0012: Bad option value for '--enable', expected a valid pylint message and got 'locally-disabledsuppressed-message' (bad-option-value)
diff --git a/tests/config/functional/toml/issue_3122/toml_with_missing_comma.4.out b/tests/config/functional/toml/issue_3122/toml_with_missing_comma.4.out
new file mode 100644
index 000000000..a7b3fff66
--- /dev/null
+++ b/tests/config/functional/toml/issue_3122/toml_with_missing_comma.4.out
@@ -0,0 +1,3 @@
+************* Module {abspath}
+{relpath}:1:0: W0012: Unknown option value for '--disable', expected a valid pylint message and got 'logging-not-lazylogging-format-interpolation' (unknown-option-value)
+{relpath}:1:0: W0012: Unknown option value for '--enable', expected a valid pylint message and got 'locally-disabledsuppressed-message' (unknown-option-value)
diff --git a/tests/config/functional/toml/unknown_msgid/enable_unknown_msgid.2.out b/tests/config/functional/toml/unknown_msgid/enable_unknown_msgid.2.out
deleted file mode 100644
index b2331660b..000000000
--- a/tests/config/functional/toml/unknown_msgid/enable_unknown_msgid.2.out
+++ /dev/null
@@ -1,3 +0,0 @@
-************* Module {abspath}
-{relpath}:1:0: E0012: Bad option value for '--disable', expected a valid pylint message and got 'logging-not-layzy' (bad-option-value)
-{relpath}:1:0: E0012: Bad option value for '--enable', expected a valid pylint message and got 'C00000' (bad-option-value)
diff --git a/tests/config/functional/toml/unknown_msgid/enable_unknown_msgid.4.out b/tests/config/functional/toml/unknown_msgid/enable_unknown_msgid.4.out
new file mode 100644
index 000000000..eea65cc52
--- /dev/null
+++ b/tests/config/functional/toml/unknown_msgid/enable_unknown_msgid.4.out
@@ -0,0 +1,3 @@
+************* Module {abspath}
+{relpath}:1:0: W0012: Unknown option value for '--disable', expected a valid pylint message and got 'logging-not-layzy' (unknown-option-value)
+{relpath}:1:0: W0012: Unknown option value for '--enable', expected a valid pylint message and got 'C00000' (unknown-option-value)
diff --git a/tests/config/test_config.py b/tests/config/test_config.py
index 45e43a0f5..ed0b745ff 100644
--- a/tests/config/test_config.py
+++ b/tests/config/test_config.py
@@ -60,7 +60,7 @@ def test_unknown_message_id(capsys: CaptureFixture) -> None:
"""Check that we correctly raise a message on an unknown id."""
Run([str(EMPTY_MODULE), "--disable=12345"], exit=False)
output = capsys.readouterr()
- assert "Command line:1:0: E0012: Bad option value for '--disable'" in output.out
+ assert "Command line:1:0: W0012: Unknown option value for '--disable'" in output.out
def test_unknown_option_name(capsys: CaptureFixture) -> None: