From 45bfe051c35ec4e80d2241095c36e67ef1836c30 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Thu, 3 Aug 2023 22:51:38 +0200 Subject: [PATCH] Fix typos discovered by codespell (#1640) --- .pre-commit-config.yaml | 8 +++++++- CONTRIBUTING.md | 2 +- django-stubs/db/models/fields/__init__.pyi | 2 +- django_stubs_ext/tests/test_monkeypatching.py | 4 ++-- pyproject.toml | 3 +++ scripts/stubtest/allowlist.txt | 2 +- tests/typecheck/managers/querysets/test_from_queryset.yml | 2 +- 7 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2cf219837..44da30478 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -13,7 +13,7 @@ repos: - id: check-merge-conflict - id: end-of-file-fixer - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.0.281 + rev: v0.0.282 hooks: - id: ruff args: ["--fix", "--exit-non-zero-on-fix"] @@ -30,6 +30,12 @@ repos: - flake8-pyi==23.5.0 types: [] files: ^.*.pyi?$ + - repo: https://github.com/codespell-project/codespell + rev: v2.2.5 + hooks: + - id: codespell + additional_dependencies: + - tomli ci: autofix_commit_msg: '[pre-commit.ci] auto fixes from pre-commit.com hooks' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 71e8df90f..ef613aa8d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -30,7 +30,7 @@ Additionally, the following resources might be useful: ### Repository Setup As a first step you will need to fork this repository and clone your fork locally. -In order to be able to continously sync your fork with the origin repository's master branch, you will need to set up an upstream master. To do so follow this [official github guide](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/syncing-a-fork). +In order to be able to continuously sync your fork with the origin repository's master branch, you will need to set up an upstream master. To do so follow this [official github guide](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests/syncing-a-fork). ### Dependency Setup diff --git a/django-stubs/db/models/fields/__init__.pyi b/django-stubs/db/models/fields/__init__.pyi index 6993fdce5..90f254d67 100644 --- a/django-stubs/db/models/fields/__init__.pyi +++ b/django-stubs/db/models/fields/__init__.pyi @@ -62,7 +62,7 @@ class Field(RegisterLookupMixin, Generic[_ST, _GT]): To understand this example you need: 1. Be familiar with descriptors: https://docs.python.org/3/howto/descriptor.html - 2. Follow our explanation bellow + 2. Follow our explanation below Let's start with defining our fake model class and fake integer field. diff --git a/django_stubs_ext/tests/test_monkeypatching.py b/django_stubs_ext/tests/test_monkeypatching.py index 2ba12ecf9..6c1d264dc 100644 --- a/django_stubs_ext/tests/test_monkeypatching.py +++ b/django_stubs_ext/tests/test_monkeypatching.py @@ -103,7 +103,7 @@ def test_patched_version_specific( django_version: _VersionSpec, make_generic_classes: _MakeGenericClasses, ) -> None: - """Test version speicific types.""" + """Test version specific types.""" make_generic_classes(django_version) for el in _need_generic: @@ -116,7 +116,7 @@ def test_mypy_builtins_not_patched_globally( ) -> None: """Ensures that builtins are not patched with `mypy` specific helpers. - This should only happend during `django.setup()` + This should only happen during `django.setup()` (https://github.com/typeddjango/django-stubs/issues/609). """ make_generic_classes(include_builtins=False) diff --git a/pyproject.toml b/pyproject.toml index c65d29367..d9641a833 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,9 @@ target-version = ['py38'] line-length = 120 include = '\.pyi?$' +[tool.codespell] +ignore-words-list = "aadd,acount,nam" + [tool.ruff] # Adds to default excludes: https://ruff.rs/docs/settings/#exclude extend-exclude = [ diff --git a/scripts/stubtest/allowlist.txt b/scripts/stubtest/allowlist.txt index 747349220..7258cc982 100644 --- a/scripts/stubtest/allowlist.txt +++ b/scripts/stubtest/allowlist.txt @@ -1,6 +1,6 @@ # This is a true allow list with things that we really don't care about. # `stubtest.generated.txt` is autogenerated by `stubtest --generate-allowlist` -# and might cointain actual problems and things that we *do want* to fix. +# and might contain actual problems and things that we *do want* to fix. # # Please, move things here when you are sure that they really should be ignored. # Comments about why things are ignored are mandatory. diff --git a/tests/typecheck/managers/querysets/test_from_queryset.yml b/tests/typecheck/managers/querysets/test_from_queryset.yml index 99b4dcb3c..aa152983f 100644 --- a/tests/typecheck/managers/querysets/test_from_queryset.yml +++ b/tests/typecheck/managers/querysets/test_from_queryset.yml @@ -484,7 +484,7 @@ # # For details see: https://github.com/typeddjango/django-stubs/issues/1022 - case: from_queryset_custom_auth_user_model - # Cache needs to be disabled to consistenly reproduce the bug + # Cache needs to be disabled to consistently reproduce the bug disable_cache: true main: | from users.models import User