-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Regression test for 3181, add documentation for toml configuration #5365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
bb66394
[doc] Add basic documentation for toml configuration files
Pierre-Sassoulas 9fc006b
Prevent crash when parsing the toml to also crash pylint
Pierre-Sassoulas 50ce066
[refactor] Permit to get the expected exit code in configuration testβ¦
Pierre-Sassoulas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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_3181/toml_decode_error.1.out
This file contains hidden or 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 @@ | ||
************* Module {abspath} | ||
{relpath}:1:0: F0011: error while parsing the configuration: Found invalid character in key name: '*'. Try quoting the key name. (line 3 column 2 char 48) (config-parse-error) |
3 changes: 3 additions & 0 deletions
3
tests/config/functional/toml/issue_3181/toml_decode_error.toml
This file contains hidden or 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 @@ | ||
# TOML decode error crash pylint | ||
[tool.pylint] | ||
*** |
3 changes: 3 additions & 0 deletions
3
tests/config/functional/toml/issue_3181/top_level_list_of_disable.2.out
This file contains hidden or 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 @@ | ||
************* Module {abspath} | ||
{relpath}:1:0: E0014: Out-of-place setting encountered in top level configuration-section 'max-line-length' : '120' (bad-configuration-section) | ||
{relpath}:1:0: E0014: Out-of-place setting encountered in top level configuration-section 'disable' : '['C0330']' (bad-configuration-section) |
4 changes: 4 additions & 0 deletions
4
tests/config/functional/toml/issue_3181/top_level_list_of_disable.toml
This file contains hidden or 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 @@ | ||
# This crashed previously see https://github.com/PyCQA/pylint/issues/3181 | ||
[tool.pylint] | ||
max-line-length = 120 | ||
disable = ["C0330"] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains hidden or 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,23 @@ | ||
import logging | ||
from pathlib import Path | ||
|
||
from pytest import LogCaptureFixture | ||
|
||
from pylint.testutils.configuration_test import get_expected_output | ||
|
||
HERE = Path(__file__).parent | ||
USER_SPECIFIC_PATH = HERE.parent.parent | ||
DATA_DIRECTORY = HERE / "data" | ||
|
||
|
||
def test_get_expected_output(caplog: LogCaptureFixture) -> None: | ||
caplog.set_level(logging.INFO) | ||
exit_code, _ = get_expected_output(DATA_DIRECTORY / "t.toml", USER_SPECIFIC_PATH) | ||
assert "Too much .out files" in str(caplog.text) | ||
assert exit_code == -1 | ||
exit_code, _ = get_expected_output(DATA_DIRECTORY / "u.toml", USER_SPECIFIC_PATH) | ||
assert exit_code == -1 | ||
assert "Wrong format for .out file name" in str(caplog.text) | ||
exit_code, _ = get_expected_output(DATA_DIRECTORY / "v.toml", USER_SPECIFIC_PATH) | ||
assert exit_code == 0 | ||
assert ".out file does not exists" in str(caplog.text) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.