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

Respect ignore configuration options when --recursive=y. #6528

Merged
merged 18 commits into from May 13, 2022

Conversation

matusvalo
Copy link
Collaborator

Type of Changes

Type
🐛 Bug fix
✨ New feature
🔨 Refactoring
📜 Docs

Description

This PR checks ignore configuration during directory discovery and ignores specified directories.

Closes #6471

@DanielNoord DanielNoord self-requested a review May 6, 2022 21:04
@matusvalo matusvalo changed the title e Respect ignore configuration options during when --recursive=y. May 6, 2022
@matusvalo matusvalo changed the title Respect ignore configuration options during when --recursive=y. Respect ignore configuration options when --recursive=y. May 6, 2022
@coveralls
Copy link

coveralls commented May 6, 2022

Pull Request Test Coverage Report for Build 2317639935

  • 9 of 9 (100.0%) changed or added relevant lines in 2 files are covered.
  • 70 unchanged lines in 11 files lost coverage.
  • Overall coverage increased (+0.001%) to 95.346%

Files with Coverage Reduction New Missed Lines %
pylint/checkers/refactoring/refactoring_checker.py 1 98.37%
pylint/testutils/functional/test_file.py 1 96.49%
pylint/checkers/classes/special_methods_checker.py 2 94.83%
pylint/lint/pylinter.py 3 94.66%
pylint/utils/ast_walker.py 3 89.06%
pylint/utils/utils.py 3 86.93%
pylint/checkers/exceptions.py 4 97.72%
pylint/utils/file_state.py 5 95.24%
pylint/checkers/utils.py 10 95.54%
pylint/pyreverse/utils.py 17 84.76%
Totals Coverage Status
Change from base Build 2296138706: 0.001%
Covered Lines: 16041
Relevant Lines: 16824

💛 - Coveralls

@Pierre-Sassoulas Pierre-Sassoulas added this to the 2.14.0 milestone May 6, 2022
@Pierre-Sassoulas Pierre-Sassoulas added the Needs backport Needs to be cherry-picked on the current patch version by a pylint's maintainer label May 6, 2022
@Pierre-Sassoulas Pierre-Sassoulas modified the milestones: 2.14.0, 2.13.9 May 6, 2022
Copy link
Member

@Pierre-Sassoulas Pierre-Sassoulas left a comment

Choose a reason for hiding this comment

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

Great, thank you @matusvalo.

With the release of 2.14 approaching I'm taking the opportunity to ask you semi-publicly here (as your shown email is a no-reply):

I've been impressed with your tenacity in getting the deprecation checks, documentation, and especially the recursive option changes. Your general contributions to pylint, is outstanding and I was wondering if you'd be interested in having commit rights to pylint and astroid.

This would allow you a great flexibility in terms of reviewing, triaging or simply getting your code in the repo faster.

Let me know if that would be of any interest to you.

Copy link
Collaborator

@DanielNoord DanielNoord left a comment

Choose a reason for hiding this comment

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

Thanks @matusvalo!

Just some small recommendations.

ChangeLog Outdated Show resolved Hide resolved
pylint/lint/expand_modules.py Outdated Show resolved Hide resolved
pylint/lint/expand_modules.py Outdated Show resolved Hide resolved
pylint/lint/pylinter.py Outdated Show resolved Hide resolved
pylint/lint/pylinter.py Outdated Show resolved Hide resolved
pylint/lint/pylinter.py Outdated Show resolved Hide resolved
@@ -1228,17 +1228,91 @@ def test_max_inferred_for_complicated_class_hierarchy() -> None:
assert not ex.value.code % 2

def test_regression_recursive(self):
"""Tests if error is raised when linter is executed over directory not using --recursive=y"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

matusvalo and others added 3 commits May 10, 2022 16:57
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
@matusvalo
Copy link
Collaborator Author

as your shown email is a no-reply

What does it mean?

I was wondering if you'd be interested in having commit rights to pylint and astroid.

Thank you. That is a honour for me. I am interested but I cannot guarantee how much time I will allocate to pylint/astroid. I am working based what is interesting in given moment. So I cannot guarantee my availability long term.

@Pierre-Sassoulas
Copy link
Member

What does it mean?

I cannot mail you at "matusvalo@users.no-reply.github.com" :)

So I cannot guarantee my availability long term.

There's no expectation of availability - even if you're the world expert in pylint's deprecation checkers (it's just very convenient if you shows up when there's a talk about something you know a lot about or if you're able to hot fix a mess by yourself) 😉

ChangeLog Outdated Show resolved Hide resolved
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
@matusvalo matusvalo merged commit 6ad350f into pylint-dev:main May 13, 2022
@matusvalo matusvalo deleted the fix_recursive_ignore branch May 13, 2022 06:06
@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 May 13, 2022
Pierre-Sassoulas added a commit that referenced this pull request May 13, 2022
* Ignore specified files/directories in recursive mode

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
@Pierre-Sassoulas
Copy link
Member

Pierre-Sassoulas commented May 13, 2022

@DanielNoord I think we used the 2.14 configuration when we use self.config.ignore, it make it hard to cherry-pick on 2.13.9. When using self.linter.config.ignore the linter is then None. Do you think it's possible to hotfix 2.13 easily or would it be too much work ? (#6563 )

Pierre-Sassoulas added a commit that referenced this pull request May 13, 2022
* Ignore specified files/directories in recursive mode

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
Pierre-Sassoulas added a commit that referenced this pull request May 13, 2022
* Ignore specified files/directories in recursive mode

Co-authored-by: Pierre Sassoulas <pierre.sassoulas@gmail.com>
Co-authored-by: Daniël van Noord <13665637+DanielNoord@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pylint does not respect ignores in --recursive=y mode
4 participants