Bot-detector / Bot-Detector-Core-Files

The server and processing files for the Bot Detector Plugin
GNU General Public License v3.0
18 stars 15 forks source link

add black formatting to github actions #461

Closed extreme4all closed 1 year ago

extreme4all commented 2 years ago

code should be formatted with python black

LukeHankey commented 2 years ago

Id recommend adding pre-commit as a whole instead of individual workflows to GHA. This allows you to just update the pre-commit config file with any new tools that are used for the project, such as flake8 or import sorting. Pre-commit can also run before committing, hence the name, which should catch any issues first.

ThorntonMatthewD commented 2 years ago

+1 for pre-commit hooks

https://user-images.githubusercontent.com/44626690/187330661-92a855f9-9015-4dca-b04e-9d79fd6f495e.mp4

extreme4all commented 2 years ago

Id recommend adding pre-commit as a whole instead of individual workflows to GHA. This allows you to just update the pre-commit config file with any new tools that are used for the project, such as flake8 or import sorting. Pre-commit can also run before committing, hence the name, which should catch any issues first.

when going through the documentation, i see the developer has to: pre-commit install and to run them pre-commit run

This does not seem automatic to me or am wrong here?

LukeHankey commented 2 years ago

The only step that wouldn't be automatic is the first command. You don't have to run pre-commit run as that would run automatically when creating a new commit

extreme4all commented 2 years ago

@LukeHankey sure sounds good then, can we also use the pylintrc found in https://google.github.io/styleguide/pyguide.html, with a few modifications?

LukeHankey commented 2 years ago

Yup. https://pylint.pycqa.org/en/latest/user_guide/installation/pre-commit-integration.html

extreme4all commented 2 years ago

@LukeHankey , @ThorntonMatthewD couldn't commit with precommit. this also requires local instalation. just python black on PR, that tells you what files & lines do not pass the linting would be perfect