Closed benjamineskola closed 2 years ago
Thanks for reporting. Due to some medical issues, I'm currently in hospital. So the solution may take some time.
The config file itself is passed as an argument to the flake8 cli call and runs flake8 in process.
Could you try copying the file to a certain location and calling
flake8 --config path/to/file
If the issue continues, than it is an issue with flake8 not with flake518.
If it works, then flake8 has changed their main method and I might have to adopt the implementation.
I've investigated further and it seems like the issue is due to the location of the temporary config file: flake8
is calculating exclude paths relative to the location of its config file, if they contain /
(exclude paths without /
can be anywhere).
So if I copy flake518
's generated configuration into the project root and execute flake8 --config ./tmp.cfg
this works, but if I copy it to my homedir and run flake8 --config ~/tmp.cfg
it will not.
The fix for this is to ensure that flake518
creates its temporary config file in the same location, e.g., by passing the dir
parameter to NamedTemporaryFile
in adapter.py#225
. I can open a PR for this for you.
Thanks for creating flake518
!
Thanks for investigating and narrowing it down to that certain issues.
I appreciate your PR, but I have some suggestions.
Thanks for creating
flake518
!
You're welcome. Thanks for using.
I'll leave the issue open until the issue is tested, ok?
(Flake518 v.1.1.0, Flake8 v3.9.2, on MacOS 12.1.)
For a Django project I’ve converted my
.flake8
file into a[tool.flake8]
section inpyproject.toml
:However, the
./library/migrations
directory is not being ignored byflake518
when I run it.In debug mode the output includes the following:
I’ve managed to narrow down a few things that it’s not:
flake518 --exclude library/migrations
works as expected.exclude = ["migrations"]
works as expected.tool.flake8
section and leaving only theexclude
does not fix it.exclude
list does not fix it.flake518
creates, moving it to.flake8
, then running.flake8
works as expected. This makes me think that it's something to do with howflake518
callsflake8
, not how it generates the config file.