Skip to content

Commit

Permalink
Add "make lint" to lint without auto-formatting
Browse files Browse the repository at this point in the history
As on CI and with tox (but not having to build and create and use a
tox environment).

This may not be the best way to do it, since currently the
project's makefiles are otherwise used only for things directly
related to building and publishing. However, this seemed like a
readily available way to run the moderately complex command that
produces the same behavior as on CI or with tox, but outside a tox
environment. It may be possible to improve on this in the future.
  • Loading branch information
EliahKagan committed Oct 3, 2023
1 parent 9b9de11 commit 5d15063
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
.PHONY: all clean release force_release
.PHONY: all lint clean release force_release

all:
@awk -F: '/^[[:alpha:]].*:/ && !/^all:/ {print $$1}' Makefile

lint:
SKIP=black-format pre-commit run --all-files --hook-stage manual

clean:
rm -rf build/ dist/ .eggs/ .tox/

Expand Down
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,8 @@ To lint, and apply automatic code formatting, run:
pre-commit run --all-files
```

Code formatting can also be done by itself by running:

```
black .
```
- Linting without modifying code can be done with: `make lint`
- Auto-formatting without other lint checks can be done with: `black .`

To typecheck, run:

Expand Down

0 comments on commit 5d15063

Please sign in to comment.