I’ve started looking at plugin development and hav...
# plugins
f
I’ve started looking at plugin development and have managed to add a new linter by copy-pasting the
docformatter
one and tweaking it to use
vulture
. All works fine — there is a lot to learn, but I think the approach taken when structuring plugin code is fairly intuitive for a newcomer. I have a specific question about the
flake8
linter available out-of-the-box with Pants. The nice thing about
flake8
is that there are tons of plugins (https://github.com/DmytroLitvinov/awesome-flake8-extensions#clean-code) which means that after installing any of those into a Python environment that has
flake8
installed, those plugins will be picked up by the
flake8
and their rules will run as well. I wonder what would be a smart thing to do to bring
flake8
plugins support in Pants into my monorepo? The
flake8
requirement is specified at https://github.com/pantsbuild/pants/blob/release_2.5.1rc3/src/python/pants/backend/python/lint/flake8/subsystem.py#L18 so I wonder how could I extend it to use multiple
flake8
plugins (each being a PyPI package) when
./pants lint
goal is run?
h
You can add any extra requirements to the
extra_requirements
option in the
flake8
scope
👍 1
There's an example here:
But basically
Copy code
[flake8]
extra_requirements.add = [
  "flake8-2020>=1.6.0,<1.7.0"
]
f
@happy-kitchen-89482 oh this is great, no idea how I missed that! I confirm that it does what I need. Noticed that
extra_requirements
is in other subsystems as well, so this is going to be very convenient. Thanks for the help!
❤️ 1