plone / plone.recipe.codeanalysis

provides static code analysis for Buildout-based Python projects, including flake8, JSHint, CSS Lint, and other code checks
https://pypi.org/project/plone.recipe.codeanalysis/
11 stars 8 forks source link

removed default flake8 settings which should be set via setup.cfg (se… #222

Closed iham closed 6 years ago

iham commented 6 years ago

…e issue #221)

iham commented 6 years ago

@gforcada can you merge and release this?

we can still use buildout flake8-settings AND use setug.cfg [flake8]

i would like to use this for bobtemplates after it is released

gforcada commented 6 years ago

Aren't those options used within plone.recipe.codeanalysis? I would expect that, if not it would not have make sense to have them to begin with.

iham commented 6 years ago

@gforcada i don't understand your answer

iham commented 6 years ago

i try to explain, what happened and what was my motivation to change that in a more detailed manner.

p.r.codeanalysis creates a code-analysis-flake8 script which handles parameters given by the buildout section (flake8-max-complexity=15) or adds parameters via setting default values in init.py (flake8-max-complexity = 10).

this parameters are added to the script to run ./flake8 --max-complexity=15 (or 10) ...

flake8 by default has a lookup for the section "[flake8]" in a certain files (setup.cfg, tox.ini, .flake8) which is usable by editors like sublimetext, vs code, eclipse AND the code-analysis-flake8 script too. so we can reduce the configs and make them DRY. flake8 sadly precedences parameters over the settings inside the file. so if the parameters are set (which they are by buildout or the defaults) and one has no chance to change them in the setup.cfg and get that recognised.

so i removed the default settings to push flake8 settings to setup.cfg you can still set params using buildout, or leave them completely to the setup.cfg to make your editor and console script behave exactly the same.

i hope this clears a bit more, what the basic motivation was. mainly:

  1. don't repeat my/your-self
  2. move settings to setup.cfg (as it is already used for isort and other stuff too)
  3. get editor and console in sync to behave the same
gforcada commented 6 years ago

@iham @gyst as there were sooo many changes, I made an alpha release of plone.recipe.codeanalysis 3.0.0a go grab it!