Skip to content

Commit 6b3b3fe

Browse files
chore(Makefile): Update linting & other checks
1 parent 9ac39e0 commit 6b3b3fe

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ All notable changes to this project will be documented in this file.
66
The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_,
77
and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.
88

9-
0.1.0b1 - 2025-01-XX
9+
0.1.0b1 - 2025-01-05
1010
--------------------
1111

1212
⚠️ **Beta Release** - Feature complete, ready for testing. API may still change before 1.0.
@@ -21,6 +21,7 @@ and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0
2121

2222
* Improved documentation structure and clarity
2323
* Contributing and changelog docs use RST include directives for single source of truth
24+
* Migrated from flake8/black/isort to Ruff for faster, unified linting and formatting
2425

2526
**Fixed**
2627

CONTRIBUTING.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ Before submitting a PR, ensure your code passes all quality checks:
9898
.. code:: bash
9999
100100
make check # Runs all checks below
101-
make lint # Flake8 linting
102-
make format # Black + isort formatting
101+
make lint # Ruff linting
102+
make format # Ruff formatting (auto-fix)
103103
make type-check # MyPy type checking
104104
make security # Bandit security scanning
105105
@@ -216,9 +216,8 @@ For new features, please:
216216
Code Style
217217
~~~~~~~~~~
218218

219-
- Follow PEP 8 (enforced by flake8)
220-
- Use Black for code formatting
221-
- Use isort for import sorting
219+
- Follow PEP 8 (enforced by Ruff)
220+
- Use Ruff for code formatting and linting
222221
- Add type hints where possible
223222
- Write docstrings for public APIs
224223

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,19 @@ test-models: ## Run model tests
8181
source $(VENV_DIR)/bin/activate && DJANGO_SETTINGS_MODULE=tests.settings python -m pytest tests/test_models.py -v --tb=short --no-cov --disable-warnings
8282

8383
# Code quality
84-
lint: ## Run linting with flake8
84+
lint: ## Run linting with ruff
8585
@echo "$(BLUE)Running linting checks...$(RESET)"
86-
source $(VENV_DIR)/bin/activate && flake8 || echo "$(YELLOW)flake8 not installed, skipping...$(RESET)"
86+
source $(VENV_DIR)/bin/activate && ruff check django_postgres_anon tests example_project || echo "$(YELLOW)ruff not installed, skipping...$(RESET)"
8787

88-
format: ## Format code with black and isort
88+
format: ## Format code with ruff
8989
@echo "$(BLUE)Formatting code...$(RESET)"
90-
source $(VENV_DIR)/bin/activate && black django_postgres_anon tests example_project --line-length=120 || echo "$(YELLOW)black not installed, skipping...$(RESET)"
91-
source $(VENV_DIR)/bin/activate && isort django_postgres_anon tests example_project --profile=black || echo "$(YELLOW)isort not installed, skipping...$(RESET)"
90+
source $(VENV_DIR)/bin/activate && ruff check --fix django_postgres_anon tests example_project || echo "$(YELLOW)ruff not installed, skipping...$(RESET)"
91+
source $(VENV_DIR)/bin/activate && ruff format django_postgres_anon tests example_project || echo "$(YELLOW)ruff not installed, skipping...$(RESET)"
9292

9393
format-check: ## Check if code formatting is correct
9494
@echo "$(BLUE)Checking code formatting...$(RESET)"
95-
source $(VENV_DIR)/bin/activate && black --check django_postgres_anon tests example_project --line-length=120 || echo "$(YELLOW)black not installed, skipping...$(RESET)"
96-
source $(VENV_DIR)/bin/activate && isort --check-only django_postgres_anon tests example_project --profile=black || echo "$(YELLOW)isort not installed, skipping...$(RESET)"
95+
source $(VENV_DIR)/bin/activate && ruff check django_postgres_anon tests example_project || echo "$(YELLOW)ruff not installed, skipping...$(RESET)"
96+
source $(VENV_DIR)/bin/activate && ruff format --check django_postgres_anon tests example_project || echo "$(YELLOW)ruff not installed, skipping...$(RESET)"
9797

9898
type-check: ## Run type checking with mypy
9999
@echo "$(BLUE)Running type checks...$(RESET)"

0 commit comments

Comments
 (0)