Skip to content

Commit

Permalink
mypy contributing (#51)
Browse files Browse the repository at this point in the history
* move pytest.ini & mypy.ini into pyproject.toml

* add instructions in CONTRIBUTING for type-checking
  • Loading branch information
joshdavham authored Aug 10, 2024
1 parent 879a141 commit 3087e1c
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
11 changes: 8 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,25 @@ Now you're ready to make changes to `src/fsrs` and see your changes reflected im

This project follows [semantic versioning](https://semver.org/), so please make sure to increment the version number in [pyproject.toml](pyproject.toml) when contributing new code.

### Lint, format and test
### Lint, type-check, format and test

Py-FSRS uses [Ruff](https://github.com/astral-sh/ruff) for linting and formatting and uses [pytest](https://docs.pytest.org) to run its tests. In order for your contribution to be accepted, your code must pass linting/formatting checks and be able to pass the tests.
Py-FSRS uses [Ruff](https://github.com/astral-sh/ruff) for linting and formatting, [mypy](https://mypy-lang.org/) for static type-checking and [pytest](https://docs.pytest.org) to run its tests. In order for your contribution to be accepted, your code must pass the linting, type-checking and formatting checks as well as the tests.

You can install these packages with
```
pip install ruff pytest
pip install ruff mypy pytest
```

Lint your code with:
```
ruff check --fix
```

Run the type-checker:
```
mypy .
```

Format your code with:
```
ruff format
Expand Down
3 changes: 0 additions & 3 deletions mypy.ini

This file was deleted.

5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,8 @@ Homepage = "https://github.com/open-spaced-repetition/py-fsrs"
[tool.ruff.lint]
ignore = ["F401", "F403", "F405", "E721"]

[tool.pytest.ini_options]
pythonpath = "src"

[tool.mypy]
ignore_missing_imports = true
2 changes: 0 additions & 2 deletions pytest.ini

This file was deleted.

0 comments on commit 3087e1c

Please sign in to comment.