moremoban/moban

the struggle between setup.py and 'black' + 'flake8'

chfw opened this issue · 2 comments

chfw commented

Just want to explain a bit more on my surprise commit:

Usually, I would use 'black' to format all codes include setup.py. And it is struggle between black and pypi-mobans because the setup.py generated from pypi-mobans always have a few times that attracts attention from 'black' and 'flake8'. Now with 'moban' stage, that checks differences between moban output and local changes, it revealed the struggle clearly.

#294

The approach we use in coala is to ignore style of files which are moban targets, such as setup.py. The source repo should generate good style, but that problem belongs in that skurce repo.

black is incompatible with isort and hard to make compatible with pycodestyle.

We have an issue in templates repo about setup.py.

An important moban enhancement is exposing the targets so templates can generate ignore lists in config files. This is already 'solved' in coala because they use .moban.yaml overrides moban.yaml so 'targets' is a part of the moban data usable by templates.

chfw commented

Regarding isort and black, the approach in pyexcel and pyecharts is to run isort first, then run black.

I will take your advice in ignore setup.py and try to make setup.py, flake8-compliant in pypi-mobans.