-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
pylint
equivalent to pylint .
#9072
Draft
Pierre-Sassoulas
wants to merge
2
commits into
pylint-dev:main
Choose a base branch
from
Pierre-Sassoulas:pylint-default-to-current-dir
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+22
−14
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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 @@ | ||
``pylint`` is now equivalent to ``pylint .`` and won't show the help by default anymore. | ||
The help is still available with ``pylint --help`` or ``pylint --long-help``. | ||
|
||
Closes #5701 |
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
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
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 |
---|---|---|
|
@@ -176,10 +176,8 @@ def __init__( | |
return | ||
|
||
# Display help if there are no files to lint or no checks enabled | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. May as well clean up this comment, as we're not displaying help (right?) |
||
if not args or len(linter.config.disable) == len( | ||
linter.msgs_store._messages_definitions | ||
): | ||
print("No files to lint: exiting.") | ||
if len(linter.config.disable) == len(linter.msgs_store._messages_definitions): | ||
print("No messages to check: exiting.") | ||
sys.exit(32) | ||
|
||
if linter.config.jobs < 0: | ||
|
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 |
---|---|---|
|
@@ -211,12 +211,12 @@ def test_nonexistent_config_file(self) -> None: | |
self._runtest(["--rcfile=/tmp/this_file_does_not_exist"], code=32) | ||
|
||
def test_error_missing_arguments(self) -> None: | ||
self._runtest([], code=32) | ||
self._runtest([], code=1) | ||
|
||
def test_disable_all(self) -> None: | ||
out = StringIO() | ||
self._runtest([UNNECESSARY_LAMBDA, "--disable=all"], out=out, code=32) | ||
assert "No files to lint: exiting." in out.getvalue().strip() | ||
assert "No messages to check: exiting." in out.getvalue().strip() | ||
|
||
def test_no_out_encoding(self) -> None: | ||
"""Test redirection of stdout with non ascii characters.""" | ||
|
@@ -491,8 +491,9 @@ def test_pylintrc_comments_in_values(self) -> None: | |
) | ||
|
||
def test_no_crash_with_formatting_regex_defaults(self) -> None: | ||
path = join(HERE, "regrtest_data", "empty.py") | ||
self._runtest( | ||
["--ignore-patterns=a"], reporter=TextReporter(StringIO()), code=32 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What was making the prior code emit 32? |
||
[path, "--ignore-patterns=a"], reporter=TextReporter(StringIO()), code=0 | ||
) | ||
|
||
def test_getdefaultencoding_crashes_with_lc_ctype_utf8(self) -> None: | ||
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not promise equivalence with
pylint .
. I'm showing a behavior difference. Before, cd to a directory you haven't installed with pip, invokepylint .
, you get a quick lint of the__init__.py
only; now you get the whole package linted.