Open idgserpro opened 6 years ago
I use flake8
, and have a Python 2 and a Python 3 virtualenv with flake8
installed, and I check compatibility by calling both commands. Using two different Python versions will not work in a buildout though.
I am not using pylint
myself, so I have no idea if this command is sane. I don't even have pylint
installed, so the pre commit hook would currently fail for me.
But the idea seems okay.
@mauritsvanrees please check this: https://community.plone.org/t/6226/25
I am not using pylint myself, so I have no idea if this command is sane. I don't even have pylint installed, so the pre commit hook would currently fail for me.
My example should have been more complete: pylint
would become a dependency for plone.recipe.codeanalysis.
Bu I do agree more discussion would be useful. For example, instead of adding --disable=no-absolute-import
to pylint
command, having pylint-py3k-check = True
would just run pylint --py3k $PATH
. If someone want to add more arguments, a pylint-py3k-check-arguments
could be added (something like https://github.com/plone/simple-plone-buildout/blob/7d424b0d970f706cc34b7b0b55a40929649f43c6/profiles/debug.cfg#L72).
In our .travis.yml we use pylint (mainly a
pylint --py3k --disable=no-absolute-import $PATH
call) to check Python 3 porting mode (since porting to Python 3 is the way to go). I just had a broken build in Travis, I can fix the errors but I would like to have this warning as apre-commit
hook so it's checked in my development machine.In a nutshell: instead of what we have now for example in buildout.plonetest:
Would receive a
pylint-py3k-check
, becoming:And in plone.recipe.codeanalysis https://github.com/plone/plone.recipe.codeanalysis/blob/98ec7c70745b47d3bb67e2e5f61d49725528fed6/plone/recipe/codeanalysis/__init__.py#L205,
pylint --py3k --disable=no-absolute-import $PATH
would be added to the git pre-commit hooks ifpylint-py3k-check
is True.What do you think?
@mauritsvanrees (since I'm quoting buildout.plonetest) and @hvelarde (since https://github.com/plonegovbr/brasil.gov.portal/pull/422 will become commonplace).