aboutsummaryrefslogtreecommitdiffstats
path: root/docs/cli_development.md
diff options
context:
space:
mode:
authorskullydazed <skullydazed@users.noreply.github.com>2019-11-20 14:54:18 -0800
committerGitHub <noreply@github.com>2019-11-20 14:54:18 -0800
commitf7bdc54c697ff24bec1bd0781666ac05401bafb2 (patch)
tree704511c89bd36582fcd0a4a05ae4812222d9b11c /docs/cli_development.md
parentd2115f7d1c3a314e997ec6800b6741d83115d6be (diff)
downloadfirmware-f7bdc54c697ff24bec1bd0781666ac05401bafb2.tar.gz
firmware-f7bdc54c697ff24bec1bd0781666ac05401bafb2.tar.bz2
firmware-f7bdc54c697ff24bec1bd0781666ac05401bafb2.zip
Add flake8 to our test suite and fix all errors (#7379)
* Add flake8 to our test suite and fix all errors * Add some documentation
Diffstat (limited to 'docs/cli_development.md')
-rw-r--r--docs/cli_development.md32
1 files changed, 32 insertions, 0 deletions
diff --git a/docs/cli_development.md b/docs/cli_development.md
index f5c7ad139..cc8c59d06 100644
--- a/docs/cli_development.md
+++ b/docs/cli_development.md
@@ -173,3 +173,35 @@ You will only be able to access these arguments using `cli.args`. For example:
```
cli.log.info('Reading from %s and writing to %s', cli.args.filename, cli.args.output)
```
+
+# Testing, and Linting, and Formatting (oh my!)
+
+We use nose2, flake8, and yapf to test, lint, and format code. You can use the `pytest` and `pyformat` subcommands to run these tests:
+
+### Testing and Linting
+
+ qmk pytest
+
+### Formatting
+
+ qmk pyformat
+
+## Formatting Details
+
+We use [yapf](https://github.com/google/yapf) to automatically format code. Our configuration is in the `[yapf]` section of `setup.cfg`.
+
+?> Tip- Many editors can use yapf as a plugin to automatically format code as you type.
+
+## Testing Details
+
+Our tests can be found in `lib/python/qmk/tests/`. You will find both unit and integration tests in this directory. We hope you will write both unit and integration tests for your code, but if you do not please favor integration tests.
+
+If your PR does not include a comprehensive set of tests please add comments like this to your code so that other people know where they can help:
+
+ # TODO(unassigned/<yourGithubUsername>): Write <unit|integration> tests
+
+We use [nose2](https://nose2.readthedocs.io/en/latest/getting_started.html) to run our tests. You can refer to the nose2 documentation for more details on what you can do in your test functions.
+
+## Linting Details
+
+We use flake8 to lint our code. Your code should pass flake8 before you open a PR. This will be checked when you run `qmk pytest` and by CI when you submit a PR.