Create pre-commit hooks
Hello everyone! I recently noticed that many people, while developing new features or maintaining old ones, face formatting issues and create new commits to their Pull Requests, in order to fix them. So, I thought that would be helpful to include pre-commit hooks that check and reformat the code, before committing any changes. A package that achieves this is the pre-commit, which is compatible with python and the flake8 checker, that Jarvis uses. This package works just by installing it and introducing a configuration file, in the repository, that indicates the hooks that will be triggered, when a commit is created. Do you think it's a good idea to include the pre-commit package for Jarvis?
More information about the pre-commit package here.
Hi! Big Thanks for the link! I will definitely take a closer look! Honestly I once did consider hooks, but decided wasn't worth the effort to make them "work". "pre-commit" does seem to solve this problem ;).
Glad to hear! If it's okay with you, I could create a PR to introduce the .pre-commit-config.yaml file that sets the configuration for the pre-commit checks. I will set it to autoformat the files according to PEP8 and then check them with the flake8 tool as TravisCI does. In any case, this addition does not oblige everyone to use the pre-commit, since in order to activate the hooks you have to install them locally. As a result, this will be a development tool to help anyone that wants it.
If it's okay with you, I could create a PR to introduce the .pre-commit-config.yaml
I would really appreciate this ;).