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

Fix handling of -- as separator of positional arguments and flags #7096

Merged
merged 1 commit into from
Jun 30, 2022

Conversation

DanielNoord
Copy link
Collaborator

  • Add yourself to CONTRIBUTORS if you are a new contributor.
  • Add a ChangeLog entry describing what your PR does.
  • If it's a new feature, or an important bug fix, add a What's New entry in
    doc/whatsnew/<current release.rst>.
  • Write a good description on what the PR does.

Type of Changes

Type
🐛 Bug fix

Description

Closes #7003.

@DanielNoord DanielNoord added Configuration Related to configuration Regression labels Jun 30, 2022
@DanielNoord DanielNoord added this to the 2.14.5 milestone Jun 30, 2022

Reported in https://github.com/PyCQA/pylint/issues/7003.
"""
Run(["--", str(EMPTY_MODULE)], exit=False)
Copy link
Member

Choose a reason for hiding this comment

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

Should we test that option are taken into account for example here an init-hook that print ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We could, but I'm fairly confident this should work. The code that this is changing is a pylint hack on top of argparse. We parse arguments with parse_known_args so argparse doesn't complain about unknown options and leaves that to us.
I simply didn't know that this is allowed so this wasn't excluded from the list of unknown options. argparse probably does dit automatically in the normale parse_args.

@DanielNoord DanielNoord merged commit cbb6eed into pylint-dev:main Jun 30, 2022
@DanielNoord DanielNoord deleted the pylint--- branch June 30, 2022 12:24
@DanielNoord DanielNoord added the Needs backport Needs to be cherry-picked on the current patch version by a pylint's maintainer label Jun 30, 2022
@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 09e7027

@Pierre-Sassoulas Pierre-Sassoulas added Backported and removed Needs backport Needs to be cherry-picked on the current patch version by a pylint's maintainer labels Jul 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pylint no longer support separating options from positional arguments with --
2 participants