Skip to content

Commit 29a1797

Browse files
committed
chore: replace black and pylint with ruff for code formatting and linting
1 parent cb903a7 commit 29a1797

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

plugins/tutor-contrib-ltistore/Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
.DEFAULT_GOAL := help
22
.PHONY: docs
33
SRC_DIRS = ./tutor_ltistore
4-
BLACK_OPTS = --exclude templates ${SRC_DIRS}
54

65
# Warning: These checks are not necessarily run on every PR.
76
test: test-lint test-types test-format # Run some static checks.
87

98
test-format: ## Run code formatting tests
10-
black --check --diff $(BLACK_OPTS)
9+
ruff format --check --diff $(SRC_DIRS)
1110

1211
test-lint: ## Run code linting tests
13-
pylint --errors-only --enable=unused-import,unused-argument --ignore=templates --ignore=docs/_ext ${SRC_DIRS}
12+
ruff check ${SRC_DIRS}
1413

1514
test-types: ## Run type checks.
1615
mypy --exclude=templates --ignore-missing-imports --implicit-reexport --strict ${SRC_DIRS}
1716

1817
format: ## Format code automatically
19-
black $(BLACK_OPTS)
18+
ruff format ${SRC_DIRS}
2019

21-
isort: ## Sort imports. This target is not mandatory because the output may be incompatible with black formatting. Provided for convenience purposes.
22-
isort --skip=templates ${SRC_DIRS}
20+
fix-lint: ## Fix lint errors automatically
21+
ruff check --fix ${SRC_DIRS}
2322

2423
ESCAPE = 
2524
help: ## Print this help

plugins/tutor-contrib-paragon/Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
.DEFAULT_GOAL := help
22
.PHONY: docs
33
SRC_DIRS = ./tutorparagon
4-
BLACK_OPTS = --exclude templates ${SRC_DIRS}
54

65
# Warning: These checks are not necessarily run on every PR.
76
test: test-lint test-types test-format # Run some static checks.
87

98
test-format: ## Run code formatting tests
10-
black --check --diff $(BLACK_OPTS)
9+
ruff format --check --diff $(SRC_DIRS)
1110

1211
test-lint: ## Run code linting tests
13-
pylint --errors-only --enable=unused-import,unused-argument --ignore=templates --ignore=docs/_ext ${SRC_DIRS}
12+
ruff check ${SRC_DIRS}
1413

1514
test-types: ## Run type checks.
1615
mypy --exclude=templates --ignore-missing-imports --implicit-reexport --strict ${SRC_DIRS}
1716

1817
format: ## Format code automatically
19-
black $(BLACK_OPTS)
18+
ruff format ${SRC_DIRS}
2019

21-
isort: ## Sort imports. This target is not mandatory because the output may be incompatible with black formatting. Provided for convenience purposes.
22-
isort --skip=templates ${SRC_DIRS}
20+
fix-lint: ## Fix lint errors automatically
21+
ruff check --fix ${SRC_DIRS}
2322

2423
unittest: ## Run code tests cases
2524
pytest tests --ignore=tests/integration

0 commit comments

Comments
 (0)