aboutsummaryrefslogtreecommitdiff
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)
downloadqmk_firmware-f7bdc54c697ff24bec1bd0781666ac05401bafb2.tar.gz
qmk_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:
173``` 173```
174cli.log.info('Reading from %s and writing to %s', cli.args.filename, cli.args.output) 174cli.log.info('Reading from %s and writing to %s', cli.args.filename, cli.args.output)
175``` 175```
176
177# Testing, and Linting, and Formatting (oh my!)
178
179We use nose2, flake8, and yapf to test, lint, and format code. You can use the `pytest` and `pyformat` subcommands to run these tests:
180
181### Testing and Linting
182
183 qmk pytest
184
185### Formatting
186
187 qmk pyformat
188
189## Formatting Details
190
191We use [yapf](https://github.com/google/yapf) to automatically format code. Our configuration is in the `[yapf]` section of `setup.cfg`.
192
193?> Tip- Many editors can use yapf as a plugin to automatically format code as you type.
194
195## Testing Details
196
197Our 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.
198
199If 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:
200
201 # TODO(unassigned/<yourGithubUsername>): Write <unit|integration> tests
202
203We 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.
204
205## Linting Details
206
207We 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.