diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c72dd1..6d8d5d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: apt-get install -y git make python3 python3-poetry --no-install-recommends poetry install --only lint,test - name: Run linters to enforce code style - run: poetry run make lint + run: poetry run make check - name: Check that the QA script is up to date with the docs run: "./dev_scripts/qa.py --check-refs" diff --git a/Makefile b/Makefile index 43c51b2..fd34b89 100644 --- a/Makefile +++ b/Makefile @@ -2,21 +2,17 @@ LARGE_TEST_REPO_DIR:=tests/test_docs_large GIT_DESC=$$(git describe) JUNIT_FLAGS := --capture=sys -o junit_logging=all -.PHONY: lint-black -lint-black: ## check python source code formatting issues, with black - black --check --diff ./ +lint-ruff: ## check the python source code with various linter rules through ruff + ruff check -.PHONY: lint-black-apply -lint-black-apply: ## apply black's source code formatting suggestions - black ./ +lint-ruff-apply: ## apply all fixes made by ruff to the source code + ruff check --fix -.PHONY: lint-isort -lint-isort: ## check imports are organized, with isort - isort --check --diff ./ +format-ruff: ## Check the formatting of the python source code with ruff + ruff format --check -.PHONY: lint-isort-apply -lint-isort-apply: ## apply isort's imports organization suggestions - isort ./ +format-ruff-apply: ## apply all the formatting suggestions from ruff + ruff format MYPY_ARGS := --ignore-missing-imports \ --disallow-incomplete-defs \ @@ -34,11 +30,11 @@ mypy-tests: mypy: mypy-host mypy-tests ## check type hints with mypy -.PHONY: lint -lint: lint-black lint-isort mypy ## check the code with various linters +.PHONY: check +check: lint-ruff format-ruff mypy ## check the code with ruff and mypy -.PHONY: lint-apply -format: lint-black-apply lint-isort-apply ## apply all the linter's suggestions +.PHONY: fix +fix: lint-ruff-apply format-ruff-apply ## apply all the suggestions from ruff .PHONY: test test: