Hi all!
The ones that know me already know that I have a slight OCD on linting
Out of plone.api
came a Plone styleguide that eventually was tried to be enforced by plone.recipe.codeanalysis.
From there plenty of flake8
plugins were born.
We even have our own profile for isort
black
has rendered any formatting discussion moot (for good ).
With python, and Plone following, moving to python 3 and a year release cadence, new syntax is coming and old one is deprecated, so more tooling (pyupgrade
and plenty others) have became sort of standards to ease upgrading the syntax.
Not all developers are native English speakers, and even so, we all make typos on our mother tongues So yet more tooling to help out (
codespell
).
All these tools are great and if you do your duty of linting a package with all of them and on top of that add some extra functionality, you are already a hero
Unfortunately the next contributor might miss to use these tools, so we are back to square one
That's where the enforcing part comes into play.
For a while GitHub Actions are the new rage in CI, so let's use them for it
Configuring a single repository is not that hard, see this example PR on plone.batching, but things start getting complex when you try to lint a package that has to be still Plone 5.2 compatible, and thus maintain python 2.7 compatibility (i.e. no fancy f-strings for you ).
Again, others came up with a solution the zope folks (
) came up with meta (not related to Facebook as far as I know
).
This repository has a set of scripts and configuration files that allow to mass-configure and for that unify configuration files, CI workflows and what not
If there is enough consensus (framework team? should I write a PLIP?) I would volunteer to do a friendly fork of that repository to the
plone
(maybe collective
as well) organization, and start configuring repositories with it.
As a wishlist one could start with the uncontroversial ones:
And add more tooling as we agree on, like:
- codespell
- flake8 (we can decide the list of plugins to enable)
- refurb
- z3c.dependencychecker
-
others? suggestions always welcome
At some point running the tests fo the package itself and get coverage reports would be nice, but that requires some extra effort (we can again follow the lead of the Zope organization and start using tox
for it, to test on multiple python versions).
There are plenty more details that could be discussed, but this is already too long, and if there is no wish for having this it might not be needed anyway to mention them
What should be the next steps forward then?
- build consensus here
- write a PLIP?
- get an early implementation
- test the approach and submit it for feedback and approval
- start using it on all plone packages
- find the problematic/complex ones and improve the tool
- keep adding more tools as we get consensus on using them