Skip to content
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's "usage" output does not say you have to specify the files to scan. #8922

Closed
ax-jrobb opened this issue Aug 3, 2023 · 1 comment
Closed
Labels
Duplicate 🐫 Duplicate of an already existing issue

Comments

@ax-jrobb
Copy link

ax-jrobb commented Aug 3, 2023

Bug description

If you just run pylint, you get the usage/help output, with exit code 32 (options error).

The actual problem is that you haven't specified any files, but literally nothing about this output communicates that fact. --long-help doesn't either.

Configuration

No response

Command used

pylint

Pylint output

The first line of the output is:

usage: pylint [options]


Followed by the standard list of options and switches -- but not one single mention of the need to specify files.

Expected behavior

IMO, the usage text should be:

usage: pylint [options] [files]

This should be accompanied by an explanation that files supports **, and that it is required unless you're specifying an option that causes pylint not to need those (e.g. because you used --from-stdin, or a command that doesn't involve a scan, such as --help, --full-documentation, etc.).

And, if you invoke pylint without specifying any files to scan, the usage text should be preceded by an error message saying you didn't specify any files to scan.

Alternative solution

Alternatively, pylint could scan the current directory recursively by default, i.e. the equivalent of:

pylint "$(pwd)"'/**/*.py'

This should still be paired with an update to the usage information to make clear that the user can specify a list of files.

Pylint version

pylint 2.17.5
astroid 2.15.6
Python 3.11.4 (main, Jul 28 2023, 14:44:21) [Clang 14.0.3 (clang-1403.0.22.14.1)]

OS / Environment

macOS 13.4.1

Additional dependencies

No response

@ax-jrobb ax-jrobb added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Aug 3, 2023
@Pierre-Sassoulas
Copy link
Member

Duplicate of #5701 this is going to be fixed in 3.0

@Pierre-Sassoulas Pierre-Sassoulas added Duplicate 🐫 Duplicate of an already existing issue and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate 🐫 Duplicate of an already existing issue
Projects
None yet
Development

No branches or pull requests

2 participants