PyCQA / PyCQA/flake8

per-file-ignores in config file should be treated relative to it

Open
#693 24 comments 10 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug:confirmed confirmed-by:core
Dominant language
Python
Stars
3.8k
Forks
356
PR merge metrics
No merged PRs in 30d

Description

In GitLab by @blueyed on Mar 7, 2019, 07:10

With tests/conftest.py:E402 in setup.cfg, flake8 run in tests will still complain about the error.

I think relative paths in config files should be treated relative to the config file's location.

Using flake8 3.7.7 (mccabe: 0.6.1, pycodestyle: 2.5.0, pyflakes: 2.1.1) CPython 3.7.2 on Linux.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the behavior with tests/conft.py and a setup.cfg containing tests/conft.py:E402, then run flake8 from the tests directory. Trace how the configuration file location and per-file-ignore path are resolved. Done means the relative path is interpreted from setup.cfg's location and the error is ignored as requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.