diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 000000000..fe9c9e018 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,10 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v3.4.0 + hooks: + - id: check-yaml + - id: end-of-file-fixer + - id: trailing-whitespace + - id: check-case-conflict + - id: fix-encoding-pragma + - id: mixed-line-ending diff --git a/README.md b/README.md index 6358522b2..1a83bd1a7 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,18 @@ You can find a copy of the license in the [LICENSE file](./LICENSE). Exemptions: * [nsz](https://github.com/nicoboss/nsz) is exempt from the GPLv3 licensing and can license any source code from this project under MIT License instead. In doing so, they may alter, supplement, or entirely remove the copyright notice for each file they choose to relicense. +## Contributing + +Contributions are welcome! + +To prevent continuous integration failures when contributing, please consider installing +[pre-commit](https://pre-commit.com/) in your environment to run all of these checks +prior to checking in new code. + +```shell +pre-commit install +``` + ## Contributors ✨ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): diff --git a/requirements_dev.txt b/requirements_dev.txt index 2e8862f7d..ee49f29b9 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -5,3 +5,4 @@ invoke~=1.4.0 coverage~=5.3 coveralls~=2.2.0 rope~=0.18.0 +pre-commit~=2.10.0