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

Normalize input of ignore-paths for all path types #5201

Merged
merged 8 commits into from
Oct 24, 2021

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
✨ New feature

Description

This normalises the input to the ignore-paths config option by creating both a Posix and Windows path from the provided regex pattern.
It does so by adding a new validator called _regexp_paths_csv_validator which creates a list of path regexs.

Furthermore, it adds a new overload to get_global_option for List[Pattern[str]] return types, as we did not have that yet.

Closes #5194

@DanielNoord DanielNoord added this to the 2.12.0 milestone Oct 23, 2021
@DanielNoord DanielNoord added Maintenance Discussion or action around maintaining pylint or the dev workflow Configuration Related to configuration Enhancement ✨ Improvement to a component labels Oct 23, 2021
@coveralls
Copy link

coveralls commented Oct 23, 2021

Pull Request Test Coverage Report for Build 1376349524

  • 11 of 11 (100.0%) changed or added relevant lines in 3 files are covered.
  • 36 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.05%) to 93.295%

Files with Coverage Reduction New Missed Lines %
pylint/checkers/variables.py 36 95.53%
Totals Coverage Status
Change from base Build 1373933286: 0.05%
Covered Lines: 13678
Relevant Lines: 14661

💛 - Coveralls

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.

Good job normalizing this aspect, this is often used in option and using the same mechanism all the time will save us from bugs and duplication.

tests/unittest_config.py Show resolved Hide resolved
pylint/config/option.py Outdated Show resolved Hide resolved
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.

Very nice cleanup !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Configuration Related to configuration Enhancement ✨ Improvement to a component Maintenance Discussion or action around maintaining pylint or the dev workflow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ignore-paths: normalize path to PosixPath
3 participants