diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 914e7da3b..e62ca3019 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,3 +32,9 @@ repos: rev: 6.0.0 hooks: - id: flake8 + - repo: https://github.com/codespell-project/codespell + rev: v2.2.5 + hooks: + - id: codespell + additional_dependencies: + - tomli diff --git a/changes/1388.misc.rst b/changes/1388.misc.rst new file mode 100644 index 000000000..96a5c9d46 --- /dev/null +++ b/changes/1388.misc.rst @@ -0,0 +1 @@ +Codespell was enabled as a pre-commit check. diff --git a/pyproject.toml b/pyproject.toml index 8a3bf1a23..cc1acc85e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,3 +74,10 @@ type = [ { directory = "doc", name = "Documentation", showcontent = true }, { directory = "misc", name = "Misc", showcontent = false }, ] + +[tool.codespell] +skip = '.git,*.pdf,*.svg' +# the way to make case sensitive skips of words etc +ignore-regex = '\bNd\b' +# case insensitive +# ignore-words-list = '' diff --git a/src/briefcase/config.py b/src/briefcase/config.py index b58a2e447..9ecf20270 100644 --- a/src/briefcase/config.py +++ b/src/briefcase/config.py @@ -373,7 +373,7 @@ def maybe_update(field, *project_fields): else: global_config[field] = datum - # Keys that map direclty + # Keys that map directly maybe_update("description", "description") maybe_update("license", "license", "text") maybe_update("url", "urls", "Homepage") diff --git a/src/briefcase/platforms/macOS/__init__.py b/src/briefcase/platforms/macOS/__init__.py index 52a242ac8..9522069d9 100644 --- a/src/briefcase/platforms/macOS/__init__.py +++ b/src/briefcase/platforms/macOS/__init__.py @@ -350,7 +350,7 @@ def sign_app(self, app, identity): # Sign all embedded frameworks sign_targets.extend(folder.rglob("*.framework")) - # Sign all embedded app objets + # Sign all embedded app objects sign_targets.extend(folder.rglob("*.app")) # Sign the bundle path itself @@ -360,7 +360,7 @@ def sign_app(self, app, identity): # However, we need to ensure that objects are signed from the inside out # (i.e., a folder must be signed *after* all it's contents has been # signed). To do this, we sort the list of signing targets in reverse - # lexigraphic order, and then group all the signing targets by parent. + # lexicographic order, and then group all the signing targets by parent. # This sorts all the signable files into folders; and sign all files in # a folder before sorting the next group. This ensures that longer paths # are signed first, and all files in a folder are signed before the diff --git a/tests/integrations/android_sdk/ADB/test_run.py b/tests/integrations/android_sdk/ADB/test_run.py index a6b114d5f..95f56e4a2 100644 --- a/tests/integrations/android_sdk/ADB/test_run.py +++ b/tests/integrations/android_sdk/ADB/test_run.py @@ -102,7 +102,7 @@ def test_error_handling(mock_tools, adb, name, exception, tmp_path): def test_older_sdk_error(mock_tools, adb): - """Failure [INSTALL_FAILED_OLDER_SDK] needs to be catched manually.""" + """Failure [INSTALL_FAILED_OLDER_SDK] needs to be caught manually.""" mock_tools.subprocess.check_output.return_value = "\n".join( [ "Performing Push Install", diff --git a/tests/platforms/linux/system/test_mixin__verify_system_packages.py b/tests/platforms/linux/system/test_mixin__verify_system_packages.py index 88f354835..3b4196e62 100644 --- a/tests/platforms/linux/system/test_mixin__verify_system_packages.py +++ b/tests/platforms/linux/system/test_mixin__verify_system_packages.py @@ -83,7 +83,7 @@ def test_missing_packages(build_command, first_app_config, capsys): """If there are missing system packages, an error is raised.""" # Mock the system requirement tools; there's a base requirement of # a packaged called "compiler", verified using "check ", and - # isntalled using "system " + # installed using "system " build_command._system_requirement_tools = MagicMock( return_value=( ["compiler"], @@ -116,7 +116,7 @@ def test_packages_installed(build_command, first_app_config, capsys): """If all required packages are installed, no error is raised.""" # Mock the system requirement tools; there's a base requirement of # a packaged called "compiler", verified using "check ", and - # isntalled using "system " + # installed using "system " build_command._system_requirement_tools = MagicMock( return_value=( ["compiler"], diff --git a/tests/platforms/linux/system/test_package.py b/tests/platforms/linux/system/test_package.py index d62b6b117..1af710bbb 100644 --- a/tests/platforms/linux/system/test_package.py +++ b/tests/platforms/linux/system/test_package.py @@ -93,7 +93,7 @@ def test_distribution_path( ("debian", "deb", "deb"), ("redhat", "rpm", "rpm"), ("arch", "pkg", "pkg"), - # This is technically posssible, but probably ill-advised + # This is technically possible, but probably ill-advised ("debian", "rpm", "rpm"), # Unknown base vendor, but explicit packaging format (None, "deb", "deb"), @@ -104,7 +104,7 @@ def test_distribution_path( def test_adjust_packaging_format( package_command, first_app, base_vendor, input_format, output_format ): - "The packaging format can be ajusted based on host system knowledge" + "The packaging format can be adjusted based on host system knowledge" first_app.target_vendor_base = base_vendor first_app.packaging_format = input_format diff --git a/tests/utils.py b/tests/utils.py index 1183b4962..e15b8e798 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -154,7 +154,7 @@ def _download_file(url, download_path, role): def create_wheel(path, package="dummy", version="1.2.3", extra_content=None): """Create a sample wheel file. - :param path: The folder where the wheel should be writter. + :param path: The folder where the wheel should be written. :param package: The name of the package in the wheel. Defaults to ``dummy`` :param version: The version number of the package. Defaults to ``1.2.3`` :param extra_content: Optional. A list of tuples of ``(path, content)`` that