Hi,
Please excuse me if this has already been answered, I couldn’t find anything online..
I’m running pylint on a module but get different scores depending on how it’s run.
It varies by ~0.2 points when run with -j=4 vs -j=1 (which is a little frustrating but not a huge deal)
It varies by up to 4 points when run in CI (Linux system) vs running locally on a macbook (not sure if the architecture is relevant here)?
Is this a known issue? Is there some way to get a consistent score?
Thanks!
Aaron
Hi all,
I wanted to share a script that I wrote recently to get flake8 to pass on a large codebase by marking all lines with violations as `# noqa: XXXX` and can be run like
```
flake8 $(git ls-files **/*.py) | noqaer.py - [--dry-run]
```
https://gist.github.com/AlexRiina/d8dfd39d2c6c4b121c8776070a2272dc
My problem was that the codebase had lots of issues like unused and undefined variables that pyflakes was rightfully flagging but in too many files for me alone to fix. Because some files were in violation, I couldn't easily incorporate flake8 into our CI.
Excluding entire files with any errors would mean most changes would be unvalidated until someone ran `flake8 --isolated` and fixed all of the violations, which didn't seem likely without organizing a major company initiative.
Since I would not be able to audit all of the changes, I decided against automatic fixers like autoflake which has the potential to introduce errors as it resolves * imports or mask extra calculations as it resolves unused variables.
My third optional was dropping a `# noqa: XXXX` on each line in violation and this script will do that all at once. I didn't quite nail errors on multi-line backslash-continued statements, but I was able to clean those up manually.
Hope you find this useful
Hello,
My team has been testing all of our python code for years using
flake8==2.5.4 and this has worked well for us until recently.
We are having more and more strictly python3 code beijing written and
we have found a bug in flake8==2.5.4 that has been fixed and an
upgrade of the version will solve our problem.
The issue is that upgrading the version leads to a lot of our code
that has already been checked in to have syntax problems. We are
willing to update our flake8 version if we can find evidence that it
is more effective to test python3 code with a newer version of flake8
such has flake8==3.7.9.
Please let me know any and all of your thoughts on this topic.
Thank you,
Adam Scerra
The latest is always going to be the "best" independent of the python
version. There's constantly bug fixes and features going into flake8
and the tools it wraps. 2.5.4 was released in 2016 when many of the
python features that are supported by the latest versions didn't even
exist (f-strings, generalized expansion, etc.)
Anthony
> Hello,
>
> My team has been testing all of our python code for years using
> flake8==2.5.4 and this has worked well for us until recently.
>
> We are having more and more strictly python3 code beijing written and
> we have found a bug in flake8==2.5.4 that has been fixed and an
> upgrade of the version will solve our problem.
>
> The issue is that upgrading the version leads to a lot of our code
> that has already been checked in to have syntax problems. We are
> willing to update our flake8 version if we can find evidence that it
> is more effective to test python3 code with a newer version of flake8
> such has flake8==3.7.9.
>
> Please let me know any and all of your thoughts on this topic.
>
> Thank you,
>
> Adam Scerra