Any idea why `flake8` reports could be off by one?
# development
c
Any idea why
flake8
reports could be off by one?
1
Locally, I get:
Copy code
src/python/pants/engine/rules_test.py:1012:9: F811 redefinition of unused 'dup_a' from line 1008
In CI however, I get:
Copy code
src/python/pants/engine/rules_test.py:1011:9: F811 redefinition of unused 'dup_a' from line 1007
I’ll just cover both lines, then… but I find it weird..
b
Are you saying
flake8
is flaky?
🤪 2
At the risk of asking a very lame question: do you have everything committed and pushed?
c
yup, pretty sure, unless there’s some files hidden due to .gitignore…
b
Got the PR?
c
also hoping I don’t have any config that gets picked up in ~/… but I don’t see how that would affect the line numbering…
b
Yeah I wouldn't imagine it does
c
Latest CI runs don’t show that issue now, as I’ve added the lint ignore comment on both lines..
I have one hypothesis about line endings which I haven’t looked at yet.. if there’s a single line using only
\r
or something funky like that… if that would even work.. ?
b
Doesn't answer your question, but IMO F811 can be silenced if
mypy
is also warning. No reason to have 2 linters for the same thing and I expect
mypy
is more powerful when it comes to detection.
I'd approve that PR 😤
c
good point.
yeah, they both complained about the dupe 😛
b
I've been trying to move us off
pylint
and move all the checks to either
mypy
or
flake8
(in company repo)
Ohh hmm one difference might be Python version. The AST module has improved over time and
flake8
might be using different attrs in later python
💯 1
c
AAahhh… right. That sounds plausible, that it would report the line with the decorator, or the actual line for the method def differently..
h
That is probably it. CI uses 3.7