Is there a recommended way to skip lint checks for...
# general
f
Is there a recommended way to skip lint checks for BUILD macro definition files? If I define a
python_sources()
for my BUILD macro, then flake8 complains that it can't resolve the target names, but these are dynamically defined by Pants and can't be imported. I'd rather not sprinkle flake8 ignores, but I'm not sure what the normal way of handling this is
b
Also, I proposed a "meta" `skip_lint_goal`: https://github.com/pantsbuild/pants/issues/16739
c
There’s also
# flake8: noqa
that will exclude warnings for the entire file. https://flake8.pycqa.org/en/3.1.1/user/ignoring-errors.html#ignoring-entire-files I was looking for a way to disable just a particular flake8 warning, for the entire file, but I couldn’t see that in the docs.. since that way, you could still benefit from the other flake8 checks in your macro file, and still not have to sprinkle every target reference.
b
I was looking for a way to disable just a particular flake8 warning
It's not possible through vanilla
flake8
. If you write a plugin though, you can monkeypatch your way into supporting it 🐒
🙉 1
🐵 1
👍 1