Skip to content

Commit 943f601

Browse files
committed
docs(readme): update parts regarding code and git commit message formats
Refs: PT-1952
1 parent dbaf53a commit 943f601

1 file changed

Lines changed: 17 additions & 24 deletions

File tree

README.md

Lines changed: 17 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
- [API Documentation](#api-documentation)
2121
- [Audit logging](#audit-logging)
2222
- [Keeping Python requirements up to date](#keeping-python-requirements-up-to-date)
23-
- [Code linting & formatting](#code-linting--formatting)
24-
- [Pre-commit hooks](#pre-commit-hooks)
23+
- [Code format](#code-format)
24+
- [Commit message format](#commit-message-format)
2525
- [Issues board](#issues-board)
2626
- [Maintaining](#maintaining)
2727
- [Enrolment reports](#enrolment-reports)
@@ -450,36 +450,29 @@ The GraphQL query/mutation and admin site views can be logged by using the mixin
450450

451451
- `pip-sync requirements.txt`
452452

453-
## Code linting & formatting
453+
## Code format
454454

455-
This project uses [ruff](https://github.com/astral-sh/ruff) for Python code linting and formatting.
456-
Ruff is configured through [pyproject.toml](./pyproject.toml).
457-
Basic `ruff` commands:
458-
459-
- Check linting: `ruff check`
460-
- Check & auto-fix linting: `ruff check --fix`
461-
- Format: `ruff format`
455+
This project uses [Ruff](https://docs.astral.sh/ruff/) for code formatting and quality checking.
462456

463-
Basically:
464-
- Ruff linter (i.e. `ruff check --fix`) does what `flake8` and `isort` did before.
465-
- Ruff formatter (i.e. `ruff format`) does what `black` did before.
457+
Basic `ruff` commands:
466458

467-
Integrations for `ruff` are available for many editors:
468-
- https://docs.astral.sh/ruff/integrations/
459+
* lint: `ruff check`
460+
* apply safe lint fixes: `ruff check --fix`
461+
* check formatting: `ruff format --check`
462+
* format: `ruff format`
469463

470-
## Pre-commit hooks
464+
[`pre-commit`](https://pre-commit.com/) can be used to install and
465+
run all the formatting tools as git hooks automatically before a
466+
commit.
471467

472-
You can use [`pre-commit`](https://pre-commit.com/) to lint and format your code before committing:
468+
## Commit message format
473469

474-
1. Install `pre-commit` (there are many ways to do that, but let's use pip as an example):
475-
- `pip install pre-commit`
476-
2. Set up git hooks from `.pre-commit-config.yaml` by running these commands from project root:
477-
- `pre-commit install` to enable pre-commit code formatting & linting
478-
- `pre-commit install --hook-type commit-msg` to enable pre-commit commit message linting
470+
New commit messages must adhere to the [Conventional Commits](https://www.conventionalcommits.org/)
471+
specification, and line length is limited to 72 characters.
479472

480-
After that, linting and formatting hooks will run against all changed files before committing.
473+
When [`pre-commit`](https://pre-commit.com/) is in use, [`commitlint`](https://github.com/conventional-changelog/commitlint)
474+
checks new commit messages for the correct format.
481475

482-
Git commit message linting is configured in [.gitlint](./.gitlint)
483476

484477
## Issues board
485478

0 commit comments

Comments
 (0)