Skip to content

Commit

Permalink
update Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Jan 4, 2024
1 parent 584b7dd commit 426bdd2
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,10 @@ test-coverage: ## Run test coverage.
# ===================================================================

ruff: ## Run ruff linter.
@git ls-files '*.py' | xargs $(PYTHON) -m ruff check --config=pyproject.toml --no-cache
@git ls-files '*.py' | xargs $(PYTHON) -m ruff check --no-cache

black: ## Python files linting (via black)
@git ls-files '*.py' | xargs $(PYTHON) -m black --config=pyproject.toml --check --safe
@git ls-files '*.py' | xargs $(PYTHON) -m black --check --safe

_pylint: ## Python pylint (not mandatory, just run it from time to time)
@git ls-files '*.py' | xargs $(PYTHON) -m pylint --rcfile=pyproject.toml --jobs=${NUM_WORKERS}
Expand All @@ -212,6 +212,7 @@ lint-toml: ## Linter for pyproject.toml
@git ls-files '*.toml' | xargs toml-sort --check

lint-all: ## Run all linters
${MAKE} black
${MAKE} ruff
${MAKE} lint-c
${MAKE} lint-rst
Expand All @@ -221,11 +222,11 @@ lint-all: ## Run all linters
# Fixers
# ===================================================================

fix-ruff:
@git ls-files '*.py' | xargs $(PYTHON) -m ruff --config=pyproject.toml --no-cache --fix

fix-black:
git ls-files '*.py' | xargs $(PYTHON) -m black --config=pyproject.toml
git ls-files '*.py' | xargs $(PYTHON) -m black

fix-ruff:
@git ls-files '*.py' | xargs $(PYTHON) -m ruff --no-cache --fix

fix-unittests: ## Fix unittest idioms.
@git ls-files '*test_*.py' | xargs $(PYTHON) -m teyit --show-stats
Expand All @@ -235,6 +236,7 @@ fix-toml: ## Fix pyproject.toml

fix-all: ## Run all code fixers.
${MAKE} fix-ruff
${MAKE} fix-black
${MAKE} fix-unittests
${MAKE} fix-toml

Expand Down

0 comments on commit 426bdd2

Please sign in to comment.