Skip to content

Commit

Permalink
refactor: rename polish-codestyle to format in Makefile
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
Undertone0809 committed Nov 3, 2024
1 parent 01ed4a2 commit a3b03b9
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 13 deletions.
8 changes: 2 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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."
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,6 @@ make pre-commit-install
Automatic formatting uses `ruff`.

```bash
make polish-codestyle

# or use synonym
make format
```

Expand Down
3 changes: 0 additions & 3 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,6 @@ make pre-commit-install
自动格式化使用 `ruff`

```bash
make polish-codestyle

# 或使用同义词
make format
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit a3b03b9

Please sign in to comment.