diff --git a/.gitignore b/.gitignore index 3274de6..60bb57b 100644 --- a/.gitignore +++ b/.gitignore @@ -103,4 +103,7 @@ ENV/ .mypy_cache/ # Project specific -tests/plugins/test.db \ No newline at end of file +tests/plugins/test.db + +# pycharm +.idea/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..60f8a6b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,18 @@ +fail_fast: false +files: ^(tests|hbmqtt|samples)/ +repos: +- repo: local + hooks: + - id: flake8 + name: flake8 + entry: flake8 + language: system + args: ["--ignore=E501,W503,W605,E722"] + types: [python] + + - id: black + name: Black + entry: black + args: [--check] + language: system + types: [python] diff --git a/contributing.md b/contributing.md new file mode 100644 index 0000000..c3f1da4 --- /dev/null +++ b/contributing.md @@ -0,0 +1,14 @@ +# Contributing to AMQTT + +:+1::tada: First off, thanks for taking the time to contribute! :tada::+1: + +The following is a set of guidelines for contributing to AMQTT on GitHub. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. + +## Testing + +When adding a new feature please add a test along with the feature. The testing coverage should not decrease. +If you encounter a bug when using AMQTT which you then resolve, please reproduce the issue in a test as well. + +## Style and linting + +We use `black` at default settings along with `flake8`. To avoid repeated pushes to satisfy our CI linter, you can use [pre-commit](https://pre-commit.com). Install the necessary hooks with `pre-commit install`. \ No newline at end of file