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

[Backport maintenance/2.15.x] Fix inconsistent argument exit code when argparse exit with its own error code #7943

Merged

Conversation

github-actions[bot]
Copy link
Contributor

Backport 62232b3 from #7931.

…rror code (#7931)

Returning 2 here is confusing as it doesn't match the documentation: https://pylint.pycqa.org/en/latest/user_guide/usage/run.html#exit-codes

* pylint: use exit code 32 when invalid arguments are passed

* pylint: add failing test when ambiguous abbreviated parameters are set in a config file

This is confusing behaviour. The output is:

```
usage: pylint [options]
pylint: error: ambiguous option: --no could match --notes, --notes-rgx, --no-docstring-rgx
```

The exit code is 2 which doesn't match the documentation: https://pylint.pycqa.org/en/latest/user_guide/usage/run.html#exit-codes

* pylint: use exit code 32 when ambiguous abbreviated parameters are set in a config file

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
(cherry picked from commit 62232b3)
@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.15.9 milestone Dec 15, 2022
@Pierre-Sassoulas Pierre-Sassoulas merged commit dca3940 into maintenance/2.15.x Dec 15, 2022
@Pierre-Sassoulas Pierre-Sassoulas deleted the backport-7931-to-maintenance/2.15.x branch December 15, 2022 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants