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

ignore-patterns incorrectly ignores some files #9273

Closed
bersbersbers opened this issue Nov 30, 2023 · 1 comment · Fixed by #9630
Closed

ignore-patterns incorrectly ignores some files #9273

bersbersbers opened this issue Nov 30, 2023 · 1 comment · Fixed by #9630
Assignees
Labels
False Negative 🦋 No message is emitted but something is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Milestone

Comments

@bersbersbers
Copy link

Bug description

pylint incorrectly excludes files.


$ tree -a
.
├── .hidden
│   └── bug.py
└── bug.py


### Configuration

_No response_

### Command used

```shell
# working: ignores .hidden, but not bug.py
pylint --recursive=y --ignore-patterns="^\..+" . 

# bug: ignores everything!
pylint --recursive=y --ignore-patterns="^\." .

Pylint output

pylint --recursive=y --ignore-patterns="^\..+" . 
************* Module bug
bug.py:1:0: C0114: Missing module docstring (missing-module-docstring)
bug.py:1:5: E0602: Undefined variable 'f' (undefined-variable)

------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00)

$ pylint --recursive=y --ignore-patterns="^\." .
$

Expected behavior

Do not ignore bug.py

Pylint version

pylint 3.0.2
astroid 3.0.1
Python 3.12.0 (main, Oct 25 2023, 10:28:41) [GCC 13.2.0]

OS / Environment

Windows and Linux

Additional dependencies

None
@bersbersbers bersbersbers added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Nov 30, 2023
@bersbersbers
Copy link
Author

Same behavior as pylint --recursive=y --ignore-patterns="^\..*" .. Maybe the same as PyCQA/pycodestyle#1217?

@mbyrnepr2 mbyrnepr2 self-assigned this May 15, 2024
@mbyrnepr2 mbyrnepr2 added Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels May 15, 2024
mbyrnepr2 added a commit to mbyrnepr2/pylint that referenced this issue May 15, 2024
…be linted is specified using a dot(``.``) and all files are ignored instead of only the files whose name begin with a dot.

Closes pylint-dev#9273
@mbyrnepr2 mbyrnepr2 added the False Negative 🦋 No message is emitted but something is wrong with the code label May 15, 2024
jacobtylerwalls pushed a commit that referenced this issue May 16, 2024
* Fix a false negative for ``--ignore-patterns`` when the directory to be linted is specified using a dot(``.``) and all files are ignored instead of only the files whose name begin with a dot.

Closes #9273
@jacobtylerwalls jacobtylerwalls added this to the 3.2.1 milestone May 16, 2024
github-actions bot pushed a commit that referenced this issue May 16, 2024
* Fix a false negative for ``--ignore-patterns`` when the directory to be linted is specified using a dot(``.``) and all files are ignored instead of only the files whose name begin with a dot.

Closes #9273

(cherry picked from commit b3aceb0)
jacobtylerwalls pushed a commit that referenced this issue May 16, 2024
* Fix a false negative for ``--ignore-patterns`` when the directory to be linted is specified using a dot(``.``) and all files are ignored instead of only the files whose name begin with a dot.

Closes #9273

(cherry picked from commit b3aceb0)
jacobtylerwalls pushed a commit that referenced this issue May 16, 2024
* Fix a false negative for ``--ignore-patterns`` when the directory to be linted is specified using a dot(``.``) and all files are ignored instead of only the files whose name begin with a dot.

Closes #9273

(cherry picked from commit b3aceb0)

Co-authored-by: Mark Byrne <31762852+mbyrnepr2@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
False Negative 🦋 No message is emitted but something is wrong with the code Needs PR This issue is accepted, sufficiently specified and now needs an implementation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants