Skip to content

Conversation

@Pierre-Sassoulas
Copy link
Member

Type of Changes

Type
✨ New feature

Description

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

@codecov
Copy link

codecov bot commented Sep 25, 2023

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.77%. Comparing base (c2907a9) to head (b2b0571).
⚠️ Report is 1311 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #9072      +/-   ##
==========================================
+ Coverage   95.57%   95.77%   +0.20%     
==========================================
  Files         178      173       -5     
  Lines       18869    18669     -200     
==========================================
- Hits        18034    17881     -153     
+ Misses        835      788      -47     
Files with missing lines Coverage Δ
pylint/config/arguments_manager.py 99.45% <ø> (+1.53%) ⬆️
pylint/lint/pylinter.py 96.66% <100.00%> (+1.34%) ⬆️
pylint/lint/run.py 87.50% <100.00%> (+0.93%) ⬆️

... and 99 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Pierre-Sassoulas
Copy link
Member Author

Pierre-Sassoulas commented Sep 25, 2023

Hmm, we might want to have it in a beta for a somewhat longish time, this feel incompatible with releasing in a week. On one hand the change is not supposed to be complex, on the other hand it actually is complex. Because the option parsing and configuration parsing is very complex (there's no explicit positional argument like you would expect with argparse, we're just implicitly relying on the first args being the fileçor_module if we don't have the stdin option -- maybe other condition apply).

@github-actions

This comment has been minimized.

Copy link
Member

@jacobtylerwalls jacobtylerwalls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Wondering if you checked pyreverse?

sys.exit(code)
return

# Display help if there are no files to lint or no checks enabled
Copy link
Member

Choose a reason for hiding this comment

The 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?)

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What was making the prior code emit 32?

Comment on lines +1 to +2
``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``.
Copy link
Member

@jacobtylerwalls jacobtylerwalls Sep 26, 2023

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, invoke pylint ., you get a quick lint of the __init__.py only; now you get the whole package linted.

@Pierre-Sassoulas
Copy link
Member Author

I'm thinking more and more that we should base it on https://github.com/pylint-dev/pylint/pull/7496/files so we can just add a default value for files instead of hacking the implicit list of args.

@DanielNoord
Copy link
Collaborator

I'm thinking more and more that we should base it on https://github.com/pylint-dev/pylint/pull/7496/files so we can just add a default value for files instead of hacking the implicit list of args.

I would be very much in favour of that, but need some direction in moving that PR forward.

@Pierre-Sassoulas
Copy link
Member Author

Let's move that change to 4.0.0 and try to add the files option in 3.1.0, I don't want to rush this.

```
    def parse_known_args(self, args=None, namespace=None):
        if args is None:
            # args default to the system args
            args = _sys.argv[1:]
        else:
            # make sure that args are mutable
            args = list(args)
```
@Pierre-Sassoulas Pierre-Sassoulas force-pushed the pylint-default-to-current-dir branch from 2955bee to b2b0571 Compare September 30, 2023 21:37
@github-actions
Copy link
Contributor

🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉

This comment was generated for commit b2b0571

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should pylint be equivalent to pylint . ?

3 participants