https://pantsbuild.org/ logo
#development
Title
# development
c

curved-television-6568

04/13/2022, 5:36 AM
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

bitter-ability-32190

04/13/2022, 1:55 PM
Are you saying
flake8
is flaky?
🤪 2
At the risk of asking a very lame question: do you have everything committed and pushed?
c

curved-television-6568

04/13/2022, 1:57 PM
yup, pretty sure, unless there’s some files hidden due to .gitignore…
b

bitter-ability-32190

04/13/2022, 1:58 PM
Got the PR?
c

curved-television-6568

04/13/2022, 1:58 PM
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

bitter-ability-32190

04/13/2022, 1:58 PM
Yeah I wouldn't imagine it does
c

curved-television-6568

04/13/2022, 1:58 PM
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

bitter-ability-32190

04/13/2022, 2:01 PM
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

curved-television-6568

04/13/2022, 2:01 PM
good point.
yeah, they both complained about the dupe 😛
b

bitter-ability-32190

04/13/2022, 2:02 PM
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

curved-television-6568

04/13/2022, 2:17 PM
AAahhh… right. That sounds plausible, that it would report the line with the decorator, or the actual line for the method def differently..
h

hundreds-father-404

04/13/2022, 10:27 PM
That is probably it. CI uses 3.7