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

Add notes-rgx option for fixme checker #3394

Merged
merged 4 commits into from
Feb 13, 2020

Conversation

BennyTheSen
Copy link
Contributor

@BennyTheSen BennyTheSen commented Feb 10, 2020

Steps

  • 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.

Description

This PR adds the option notes-rgx which can be used to flag the fixme warnings more flexible with a regex.
Also extends the fixme functional test to include the notes and the notes-rgx option

Type of Changes

Type
🐛 Bug fix
✨ New feature
🔨 Refactoring
📜 Docs

Related Issue

Copy link
Contributor

@PCManticore PCManticore left a comment

Choose a reason for hiding this comment

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

Hey @BennyTheSen Solid effort! Overall it looks great, but left a couple of comments to be addressed before we can merge this in.

@@ -82,3 +82,5 @@ separated list of regexes, that if a name matches will be always marked as a bla
* Add new --fail-under flag for setting the threshold for the score to fail overall tests. If the score is over the fail-under threshold, pylint will complete SystemExit with value 0 to indicate no errors.

* Add a new check (non-str-assignment-to-dunder-name) to ensure that only strings are assigned to ``__name__`` attributes

* Add a new option ``notes-rgx`` to make fixme warnings more flexible
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's mention here that either notes-rgx or notes can be used.

{
"type": "string",
"metavar": "<regexp>",
"default": ("a^"),
Copy link
Contributor

Choose a reason for hiding this comment

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

This should not have a default. Let's remove it from line 102.

pylintrc Outdated
@@ -103,6 +103,8 @@ logging-modules=logging
# List of note tags to take in consideration, separated by a comma.
notes=FIXME,XXX,TODO

# Regular expression of note tags to take in consideration.
notes-rgx=a^
Copy link
Contributor

Choose a reason for hiding this comment

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

This needs to be removed.

@@ -18,6 +18,15 @@ def function():
#FIXME: no space after hash
# +1: [fixme]
#todo: no space after hash

# +1: [fixme]
Copy link
Contributor

Choose a reason for hiding this comment

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

These are some nice tests!

@BennyTheSen
Copy link
Contributor Author

Hey @PCManticore thanks for the input, I resolved your comments.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 90.349% when pulling a1be981 on BennyTheSen:feature/notes-rgx into 51c646b on PyCQA:master.

@coveralls
Copy link

coveralls commented Feb 11, 2020

Coverage Status

Coverage increased (+0.003%) to 90.374% when pulling d151f31 on BennyTheSen:feature/notes-rgx into be02bc7 on PyCQA:master.

@PCManticore PCManticore merged commit 8956979 into pylint-dev:master Feb 13, 2020
@PCManticore
Copy link
Contributor

Thanks a lot @BennyTheSen !

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.

3 participants