Skip to content

Commit dde186c

Browse files
committed
Update documentation
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
1 parent 0c12705 commit dde186c

2 files changed

Lines changed: 51 additions & 1 deletion

File tree

CONTRIBUTING.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,19 @@ Once you've made your changes, update the snapshot files such that they reflect
4141
pytest --snapshot-update
4242
```
4343

44+
Before submitting a pull request, ensure that all code quality checks pass:
45+
46+
```bash
47+
# Run linter and type checker
48+
ruff check . && mypy src/
49+
```
50+
4451
Finally, submit a pull request with a clear description of your changes and the sources you used for verification.
4552

4653
## Code Style and Best Practices
4754

48-
- Follow PEP 8 style guidelines
55+
- Follow PEP 8 style guidelines (enforced by [ruff](https://docs.astral.sh/ruff/))
56+
- Use type hints for all function signatures and variable declarations (checked by [mypy](https://mypy-lang.org/))
4957
- Write clear, descriptive docstrings using Google-style format
5058
- Keep your changes focused and well-documented
5159

docs/how-tos/getting-started.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,48 @@ When adding new countries or modifying existing ones, you may need to generate n
111111
pytest --snapshot-update
112112
```
113113

114+
## Step 6: Code Quality and Linting
115+
116+
The holidata project uses [ruff](https://docs.astral.sh/ruff/) for linting and code formatting, and [mypy](https://mypy-lang.org/) for static type checking.
117+
118+
### Install Linting Tools
119+
120+
Install the linting tools:
121+
122+
```bash
123+
pip install ruff mypy
124+
```
125+
126+
### Run Ruff
127+
128+
To check your code for style and import issues:
129+
130+
```bash
131+
ruff check .
132+
```
133+
134+
To automatically fix issues where possible:
135+
136+
```bash
137+
ruff check --fix .
138+
```
139+
140+
### Run MyPy
141+
142+
To perform static type checking:
143+
144+
```bash
145+
mypy src/
146+
```
147+
148+
### Running All Checks
149+
150+
The project's CI pipeline runs both linting tools. Before submitting a pull request, ensure both checks pass:
151+
152+
```bash
153+
ruff check . && mypy src/
154+
```
155+
114156
## Next Steps
115157

116158
After setting up your environment, take a look at how to [add a new country](add-country.md) or how to [define a holiday](define-holidays.md).

0 commit comments

Comments
 (0)