From 9e230b3b7d2418bd79c94d03bf5f45d2a601865f Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Sat, 14 Sep 2024 23:37:52 +0300 Subject: [PATCH] Improve docs about pre-commit and mypy --- .pre-commit-config.yaml | 6 +++--- docs/contributing/lint.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a8ddb6b6dd..3b995d2f1e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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. diff --git a/docs/contributing/lint.md b/docs/contributing/lint.md index 7b449179a4..350f07dd27 100644 --- a/docs/contributing/lint.md +++ b/docs/contributing/lint.md @@ -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) ```