klen / pylama

Code audit tool for python.
MIT License
1.05k stars 99 forks source link

Exclude/Ignore is not working #156

Closed dpizetta closed 2 years ago

dpizetta commented 5 years ago

Maybe the style is being passed wrong to pycodestyle.

How to reproduce

1) In tox.ini create:

[pycodestyle]
exclude = .tox

2) Run tox and pylama try to test everything inside .tox, example:

pylama -v --options=tox.ini

File is reading: .tox/py36-test/bin/rst2odt.py
Run pycodestyle {'ignore': ['E501', 'C0301'], 'exclude': ['.tox', '.env', '.venv', '.git', 'build', 'dist', 'docs', 'tests', 'ui', '*.egg-info', '*cache*'], 'max-line-length': 100, 'statistics': ('T', 'r', 'u', 'e'), 'count': ('T', 'r', 'u', 'e')}

3) Using the same configuration file, from tox.ini, but directly with pycodestyle:

pycodestyle --config=tox.ini -v

cli configuration: tox.ini
directory .
checking ./setup.py
directory ./helpdev
checking ./helpdev/__init__.py
checking ./helpdev/__main__.py
directory ./examples
directory ./.vscode

4) Executing passing a list insteady of a string seems to result the same as the problem with pylama:

pycodestyle --exclude=['.tox'] -vv

Maybe something related to #143, but for me, it does not match the description. Tks

Info about the environment:

* HARDWARE-----------------------------------------------------------------------
    - Machine....................... x86_64
    - Processor..................... Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
    - Total Memory.................. 16689 MB
    - Free Memory................... 2166 MB
    - Total Swap.................... 19999 MB
    - Free Swap..................... 19999 MB
* OPERATING SYSTEM---------------------------------------------------------------
    - System........................ Linux
    - Release....................... 4.15.0-48-generic
    - Platform...................... Linux-4.15.0-48-generic-x86_64-with-debian-buster-sid
    - Version....................... #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019
* THREADS------------------------------------------------------------------------
    - Version....................... NPTL 2.27
    - Name.......................... pthread
    - Lock.......................... semaphore
* PYTHON DISTRIBUTION------------------------------------------------------------
    - Version....................... 3.6.8
    - C Compiler.................... GCC 7.3.0
    - C API Version................. 1013
    - Implementation................ cpython
    - Implementation Version........ 3.6.8
* PYTHON PACKAGES----------------------------------------------------------------
    - pycodestyle................... 2.5.0
    - pylama........................ 7.7.1
    - tox........................... 3.9.0
--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/74242849-exclude-ignore-is-not-working?utm_campaign=plugin&utm_content=tracker%2F394650&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F394650&utm_medium=issues&utm_source=github).
dpizetta commented 5 years ago

Same happening with pydocstyle that accepts a regex. If I keep only the skip option in pylama, it not works - it is not passed to the linters.

dpizetta commented 5 years ago

Related to all #151 #143 #86. I think all keys should be revised. Tks

jameswilliams1 commented 4 years ago

Having the same issue, want to ignore docs/ directory and it lints anyway and breaks precommit hooks. Using a shell wildcard (docs/**) seems to do the trick though.

remort commented 4 years ago
 [pylama:pydocstyle]
 ignore=D100,D203,D405

this (and variants) doesn't work

remort commented 4 years ago

ignore for pydocstyle error codes works in main, [pylama], section.

klen commented 2 years ago

Thank you for the report. The issue has been fixed.