File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ pip install -r requirements.lint.txt
8585# Run lint
8686inv lint
8787# Run formatter (will tell you which files it modified)
88- inv lint -- format
88+ inv format
8989```
9090
9191If you get the error ` ERROR:darker.git:fatal: Not a valid commit name <hash> ` ,
Original file line number Diff line number Diff line change @@ -31,14 +31,22 @@ def _migrate_file(url: str, filename: str):
3131
3232
3333@task
34- def lint (c , format = False , revision = "origin/dev" ):
35- """Lint and format .
34+ def lint (c , revision = "origin/dev" ):
35+ """Lint.
3636
37- Linter/formatter are automatically read from `pyproject.toml`.
37+ Linters automatically read from `pyproject.toml`.
3838 """
39- diff = "--diff --check" if not format else ""
40- c .run (f"darker { diff } --revision { revision } ." , warn = True )
39+ c .run (f"darker --diff --check --revision { revision } ." , warn = True )
4140 c .run ("echo '\n '" )
4241 out = c .run (f"git diff -U0 { revision } | lint-diffs" )
4342 if out .stdout .strip () != "=== pylint: mine=0, always=0" :
4443 print (out .stdout )
44+
45+
46+ @task
47+ def format (c , revision = "origin/dev" ): # pylint: disable=redefined-builtin
48+ """Format.
49+
50+ Darker will format files for you and print which ones changed.
51+ """
52+ c .run (f"darker --verbose --revision { revision } ." , warn = True )
You can’t perform that action at this time.
0 commit comments