diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a921b5c..d440d57 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -27,7 +27,7 @@ repos: types: [file, python] - repo: https://github.com/pycqa/isort - rev: 5.9.3 + rev: 5.10.0 hooks: - id: isort args: ["--profile", "black", "--filter-files"] @@ -38,5 +38,6 @@ repos: - id: flake8 language: python files: ^gml_application_schema_toolbox/.*\.py$ - types: [python] + additional_dependencies: ["flake8-annotations<3", "flake8-docstrings<2"] args: ["--config=setup.cfg", "--select=E9,F63,F7,F82"] + types: [python] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c555e3..83fb080 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ # Contributing Guidelines -:+1::tada: First off, thanks for considering to contribute to this project! :tada::+1: +First off, thanks for considering to contribute to this project! These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request. @@ -17,3 +17,18 @@ Make sure your code *roughly* follows [PEP-8](https://www.python.org/dev/peps/pe - docstrings: [sphinx-style](https://sphinx-rtd-tutorial.readthedocs.io/en/latest/docstrings.html#the-sphinx-docstring-format) is used to write technical documentation. - formatting: [black](https://black.readthedocs.io/) is used to automatically format the code without debate. - static analisis: [flake8](https://flake8.pycqa.org/en/latest/) is used to catch some dizziness and keep the source code healthy. +- static typing: following [PEP-484](https://www.python.org/dev/peps/pep-0484/) type annotations are used to improve code readability and reliability. + +---- + +## Git flow + +### Branches naming pattern + +The pattern is: `{category}/{issue-code}_-_{slugified-description}`. Where: + +- `category` is the type of work. Can be: `feature`, `bug`, `tooling`, `refactor`, `test`, `chore`, `release`, `hotfix`, `docs`, `ci`, `deploy` or `release-candidate`. +- `issue-code` is the GitHub issue number followed by an underscore. If it's not relevant, ignore this. +- `slugified-description` is the description of the work, slugified. + +Example: `feature/137_content_negociation` diff --git a/requirements/development.txt b/requirements/development.txt index f0846d7..6ac41a7 100644 --- a/requirements/development.txt +++ b/requirements/development.txt @@ -3,7 +3,9 @@ black flake8>=3.8,<4.1 +flake8-annotations<2.8 flake8-builtins>=1.5,<1.6 +flake8-docstrings<1.7 flake8-eradicate>=1.0,<1.3 flake8-isort>=4.0,<4.2 pre-commit>=2.12,<2.16 diff --git a/setup.cfg b/setup.cfg index eb2f7b6..4df5ae7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,7 +32,7 @@ exclude = tests, # do not consider external packages */external/*, ext_libs/* -ignore = E121,E123,E126,E203,E226,E24,E704,W503,W504 +ignore = ANN101, ANN102, D104, D400, D401, E121,E123,E126,E203,E226,E24,E704,W503,W504 max-complexity = 15 max-doc-length = 130 max-line-length = 100