From a3b03b9aa2f3c52735fe4579e143b9361280eaa3 Mon Sep 17 00:00:00 2001 From: zeeland Date: Mon, 4 Nov 2024 04:42:17 +0800 Subject: [PATCH] refactor: rename polish-codestyle to format in Makefile - Rename 'polish-codestyle' target to 'format' in Makefile - Update documentation in README.md and README_zh.md to reflect the new target name - Remove redundant 'formatting' target from Makefile This change standardizes the naming convention for code formatting commands, making it more intuitive for users. --- Makefile | 8 ++------ README.md | 3 --- README_zh.md | 3 --- .../DELETE_ME.md | 2 +- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index d6b5f33..dd9cebd 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ else TEST_COMMAND := PYTHONPATH=$(PYTHONPATH) poetry run pytest -c pyproject.toml --cov-report=html --cov=hooks tests/ endif -.PHONY: lock install pre-commit-install pre-commit-uninstall polish-codestyle formatting format test check-codestyle check-safety lint help +.PHONY: lock install pre-commit-install pre-commit-uninstall format test check-codestyle check-safety lint help install: poetry lock -n && poetry export --without-hashes > requirements.txt @@ -23,12 +23,10 @@ pre-commit-install: pre-commit-uninstall: poetry run pre-commit uninstall -polish-codestyle: +format: poetry run ruff format --config pyproject.toml hooks tests p3g poetry run ruff check --fix --config pyproject.toml hooks tests p3g -format: polish-codestyle - test: $(TEST_COMMAND) poetry run coverage-badge -o assets/images/coverage.svg -f @@ -49,8 +47,6 @@ help: @echo "install: Install the project dependencies." @echo "pre-commit-install: Install the pre-commit hooks." @echo "pre-commit-uninstall: Uninstall the pre-commit hooks." - @echo "polish-codestyle: Format the codebase using ruff." - @echo "formatting: Format the codebase using ruff." @echo "format: Format the codebase using ruff." @echo "test: Run the test suite." @echo "check-codestyle: Check the codebase using ruff." diff --git a/README.md b/README.md index 04865a7..fef39a7 100644 --- a/README.md +++ b/README.md @@ -188,9 +188,6 @@ make pre-commit-install Automatic formatting uses `ruff`. ```bash -make polish-codestyle - -# or use synonym make format ``` diff --git a/README_zh.md b/README_zh.md index 728fd4a..88b0ef3 100644 --- a/README_zh.md +++ b/README_zh.md @@ -179,9 +179,6 @@ make pre-commit-install 自动格式化使用 `ruff`。 ```bash -make polish-codestyle - -# 或使用同义词 make format ``` diff --git a/{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}/DELETE_ME.md b/{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}/DELETE_ME.md index 8960cda..722580a 100644 --- a/{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}/DELETE_ME.md +++ b/{{ cookiecutter.project_name.lower().replace(' ', '_').replace('-', '_') }}/DELETE_ME.md @@ -45,7 +45,7 @@ priority = "default" 4. Run the codestyle to polish your code: ```bash -make polish-codestyle +make format ``` 5. Upload initial code to GitHub: