mintel / build-harness

🤖Collection of Makefiles to facilitate building Python/Golang projects, Dockerfiles, and more
Apache License 2.0
2 stars 6 forks source link

Lint should include unused import detection #28

Closed xiang-zhu closed 4 years ago

xiang-zhu commented 4 years ago

Follow the same logic as https://prettier.io/docs/en/comparison.html lint should cover both formatting and code quality check. Currently black and isort provide the check of code formating, but the code quality check for issues like unused import is missing

charlieparkes commented 4 years ago

I agree! Would you please include a list of tools, commands, and config you use to accomplish this? I'll get it integrated and open an MR.

xiang-zhu commented 4 years ago

The tool I use for this is flake8 https://github.com/PyCQA/flake8 but need to configure it to ignore check we want black to handle

An example config

[flake8]
ignore =
    E203, # https://github.com/psf/black/issues/315
    W503, # https://github.com/psf/black/pull/36
    E501, # Let black handle line length