Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

codespell: add config and pre-commit config to codespell the code to avoid known typos #1388

Merged
merged 6 commits into from
Jul 29, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,10 @@ 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
7 changes: 7 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
2 changes: 1 addition & 1 deletion src/briefcase/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
4 changes: 2 additions & 2 deletions src/briefcase/platforms/macOS/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/integrations/android_sdk/ADB/test_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 <pkg>", and
# isntalled using "system <pkg>"
# installed using "system <pkg>"
build_command._system_requirement_tools = MagicMock(
return_value=(
["compiler"],
Expand Down Expand Up @@ -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 <pkg>", and
# isntalled using "system <pkg>"
# installed using "system <pkg>"
build_command._system_requirement_tools = MagicMock(
return_value=(
["compiler"],
Expand Down
4 changes: 2 additions & 2 deletions tests/platforms/linux/system/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading