Skip to content
Snippets Groups Projects
Commit 9d0ae152 authored by Todd Dembrey's avatar Todd Dembrey
Browse files

Centralise linting commands in the makefile

- Add missing PHONY definition for `help`
- Add `lint` command to run both isort and flake8
- Add `style` command to run flake8
- Rename `fix` to `sort-fix` to fix the isort errors
- Remove exit code from `sort` as it hid errors and emits error codes anyway
parent ceb74015
No related branches found
No related tags found
No related merge requests found
.PHONY:
.PHONY: help
help:
@echo "Usage:"
@echo " make help prints this help."
@echo " make fix fix import sort order."
@echo " make sort run the linter."
@echo " make lint run all python linting."
@echo " make sort run the isort import linter."
@echo " make sort-fix fix import sort order."
@echo " make style run the python code style linter."
.PHONY: fix
fix:
isort -y
.PHONY: lint
lint: sort style
.PHONY: sort
sort:
@echo "Running Isort" && isort --check-only --diff || exit 1
@echo "Checking imports with isort" && isort --check-only --diff
.PHONY: sort-fix
sort-fix:
@echo "Fixing imports with isort" && isort --apply
.PHONY: style
style:
@echo "Checking code style with flake8" && flake8
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment