Skip to content

Commit c87e01f

Browse files
committed
Add an "invoke formatters" command
1 parent 86a0d7a commit c87e01f

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ using `invoke standalone-tests`; similarly, RedisCluster tests can be run by usi
8181
Each run of tests starts and stops the various dockers required. Sometimes
8282
things get stuck, an `invoke clean` can help.
8383

84+
## Linting and Formatting
85+
86+
Call `invoke linters` to run linters without also running tests. This command will
87+
only report issues, not fix them automatically. Run `invoke formatters` to
88+
automatically format your code.
89+
8490
## Documentation
8591

8692
If relevant, update the code documentation, via docstrings, or in `/docs`.

tasks.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ def linters(c):
3333
run("vulture redis whitelist.py --min-confidence 80")
3434
run("flynt --fail-on-change --dry-run tests redis")
3535

36+
@task
37+
def formatters(c):
38+
"""Format code"""
39+
run("black --target-version py37 tests redis")
40+
run("isort tests redis")
41+
3642

3743
@task
3844
def all_tests(c):

0 commit comments

Comments
 (0)