Skip to content

Commit

Permalink
From black/pylint to ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
rgonzalezfluendo committed Jan 26, 2024
1 parent 9eda9f5 commit f5785d2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
16 changes: 7 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,18 @@ ifneq ($(OS),Windows_NT)
endif
@echo "\nAll test finished succesfully!"

format: ## format Python code using black
@echo "Formatting coding style with black..."
black $(PY_FILES)
format: ## format Python code using ruff
@echo "Formatting coding style with ruff..."
ruff format --fix $(PY_FILES)

format-check:
@echo "Checking coding style with black... Run '$(MAKE) format' to fix if needed"
black --check $(PY_FILES)
@echo "Checking coding style with ruff... Run '$(MAKE) format' to fix if needed"
ruff format $(PY_FILES)

lint: format-check ## run static analysis using pylint, flake8 and mypy
# ignore similar lines error: it's a bug when running parallel jobs - https://github.com/PyCQA/pylint/issues/4118
@echo "Checking with pylint... "
pylint --fail-under=10.0 $(PY_FILES)
@echo "Checking with flake8..."
flake8 --max-line-length=120 $(PY_FILES)
@echo "Checking with ruff... "
ruff check $(PY_FILES)
@echo "Checking with mypy..."
mypy --strict $(PY_FILES)

Expand Down
4 changes: 1 addition & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ packages = ["fluster", "fluster.decoders"]

[project.optional-dependencies]
dev = [
"black",
"pylint",
"flake8",
"ruff",
"mypy"
]

Expand Down
4 changes: 1 addition & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
black
pylint
flake8
ruff
mypy

0 comments on commit f5785d2

Please sign in to comment.