From db585c895a13b4cea2cf07349c7fc12d48a51e8d Mon Sep 17 00:00:00 2001 From: lukken <lukken@astron.nl> Date: Wed, 14 Sep 2022 07:54:39 +0200 Subject: [PATCH] CWG-11: linting auto format and appropriate documentation --- README.md | 17 ++++++++++++++++- tests/requirements.txt | 1 + tox.ini | 6 +++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 605e1f0..979ee10 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,22 @@ cool_module.greeter() # prints "Hello World" ## Contributing To contribute, please create a feature branch and a "Draft" merge request. -Upon completion, the merge request should be marked as ready and a reviewer should be assigned. +Upon completion, the merge request should be marked as ready and a reviewer +should be assigned. + +Verify your changes locally and be sure to add tests. Verifying local +changes is done through `tox`. + +```pip install tox``` + +With tox the same jobs as run on the CI/CD pipeline can be ran. These +include unit tests and linting. + +```tox``` + +To automatically apply most suggested linting changes execute: + +```tox -e format``` ## License This project is licensed under the Apache License Version 2.0 diff --git a/tests/requirements.txt b/tests/requirements.txt index c28d83e..cccf4e8 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,6 +1,7 @@ black build flake8 +autopep8 >= 1.7.0 # MIT pylint pytest pytest-cov diff --git a/tox.ini b/tox.ini index 0c73407..fee6821 100644 --- a/tox.ini +++ b/tox.ini @@ -20,7 +20,7 @@ commands = # Use generative name and command prefixes to reuse the same virtualenv # for all linting jobs. -[testenv:{pep8,black,pylint}] +[testenv:{pep8,black,pylint,format}] usedevelop = False envdir = {toxworkdir}/linting commands = @@ -30,6 +30,10 @@ commands = black: {envpython} -m black --check --diff . pylint: {envpython} -m pylint --version pylint: {envpython} -m pylint map tests + format: {envpython} -m autopep8 -v -aa --in-place --recursive map + format: {envpython} -m autopep8 -v -aa --in-place --recursive tests + format: {envpython} -m black -v . + [testenv:build] usedevelop = False -- GitLab