File tree 2 files changed +12
-2
lines changed
2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -84,6 +84,8 @@ source venv/bin/activate
84
84
pip install -r requirements.lint.txt
85
85
# Run lint
86
86
inv lint
87
+ # Run formatter (will tell you which files it modified)
88
+ inv format
87
89
```
88
90
89
91
If you get the error ` ERROR:darker.git:fatal: Not a valid commit name <hash> ` ,
Original file line number Diff line number Diff line change @@ -34,11 +34,19 @@ def _migrate_file(url: str, filename: str):
34
34
def lint (c , revision = "origin/dev" ):
35
35
"""Lint and format.
36
36
37
- Additional linter settings can be found in `pyproject.toml` (`darker` will
38
- use those settings as well).
37
+ Linter/formatter are automatically read from `pyproject.toml`.
39
38
"""
40
39
c .run (f"darker --diff --check --revision { revision } ." , warn = True )
41
40
c .run ("echo '\n '" )
42
41
out = c .run (f"git diff -U0 { revision } | lint-diffs" )
43
42
if out .stdout .strip () != "=== pylint: mine=0, always=0" :
44
43
print (out .stdout )
44
+
45
+
46
+ @task
47
+ def format (c , revision = "origin/dev" ):
48
+ """Format code.
49
+
50
+ Linter/formatter are automatically read from `pyproject.toml`.
51
+ """
52
+ c .run (f"darker --verbose --revision { revision } ." , warn = True )
You can’t perform that action at this time.
0 commit comments