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

Support ignoring blacklists by name #1046

Merged
merged 3 commits into from Aug 18, 2023

Conversation

costaparas
Copy link
Contributor

This extends nosec parsing to enable blacklists to be ignored by their name, not just by id.

There were 2 issues with the previous implementation:

  1. The regex did not match numbers, which is needed for some names, such as md5. The code would only match "md" in this case.
  2. The function that maps plugin names to ids only considered plugins but not blacklists.

Both of these are now addressed.

Closes #988

This extends nosec parsing to enable blacklists to be ignored by
their name, not just by id.

There were 2 issues with the previous implementation:
1. The regex did not match numbers, which is needed for some names,
   such as md5. The code would only match "md" in this case.
2. The function that maps plugin names to ids only considered plugins
   but not blacklists.

Both of these are now addressed.

Closes PyCQA#988
The original code considered plugins, but not blacklists.
Since the code now correctly considers both types of tests,
the function and variables should be renamed to avoid confusion.
@costaparas costaparas force-pushed the feature/blacklists-ignorable-by-name branch from 05bd875 to d24d179 Compare August 17, 2023 04:02
Copy link
Member

@ericwb ericwb left a comment

Choose a reason for hiding this comment

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

Nice fix

@ericwb ericwb merged commit 6d1d11c into PyCQA:main Aug 18, 2023
11 checks passed
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.

B410: import_lxml not ignorable by name
2 participants