Skip to content

Commit

Permalink
Tweak linting target (#171)
Browse files Browse the repository at this point in the history
* Makefile: split `lint` and `reformat` targets

Signed-off-by: William Woodruff <william@trailofbits.com>

* CONTRIBUTING: document `make reformat`

Signed-off-by: William Woodruff <william@trailofbits.com>
  • Loading branch information
woodruffw committed Jul 21, 2022
1 parent f35a621 commit a035704
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ make lint
* [`interrogate`](https://interrogate.readthedocs.io/en/latest/): Documentation coverage


To automatically apply any lint-suggested changes, you can run:

```bash
make reformat
```

### Testing

You can run the tests locally with:
Expand Down
10 changes: 7 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,17 @@ run:
.PHONY: lint
lint:
. env/bin/activate && \
black $(ALL_PY_SRCS) && \
isort $(ALL_PY_SRCS) && \
black --check $(ALL_PY_SRCS) && \
isort --check $(ALL_PY_SRCS) && \
flake8 $(ALL_PY_SRCS) && \
mypy $(PY_MODULE) && \
bandit -c pyproject.toml -r $(PY_MODULE)

git diff --exit-code
.PHONY: reformat
reformat:
. env/bin/activate && \
black $(ALL_PY_SRCS) && \
isort $(ALL_PY_SRCS)

.PHONY: test
test:
Expand Down

0 comments on commit a035704

Please sign in to comment.