Skip to content

Commit

Permalink
Improve docs about pre-commit and mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
mathbunnyru committed Sep 14, 2024
1 parent 3483dfa commit 9e230b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ repos:
"types-tabulate",
"types-urllib3",
]
# Unfortunately, `pre-commit` only runs on changed files
# Unfortunately, `pre-commit` only runs on modified files
# This doesn't work well with `mypy --follow-imports error`
# See: https://github.com/pre-commit/mirrors-mypy/issues/34#issuecomment-1062160321
#
# To work around this we run `mypy` only in manual mode
# So it won't run as part of `git commit` command
# But it will still be run as part of `pre-commit` workflow and give expected results
# So it won't run as part of `git commit` command,
# but it will still be run as part of `pre-commit` workflow and give expected results
stages: [manual]

# Autoformat: YAML, JSON, Markdown, etc.
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing/lint.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ pre-commit run --all-files --hook-stage manual
```

```{note}
We're running `pre-commit` with `--hook-stage manual`, because works with changed files, which doesn't work well for mypy.
We're running `pre-commit` with `--hook-stage manual`, because `pre-commit` is run on modified files only, which doesn't work well with `mypy --follow-imports error`.
More information can be found in [`.pre-commit-config.yaml` file](https://github.com/jupyter/docker-stacks/blob/main/.pre-commit-config.yaml)
```

Expand Down

0 comments on commit 9e230b3

Please sign in to comment.