From d5af35ea3c8a5dd8a622fa30de112a3faba7b2d2 Mon Sep 17 00:00:00 2001 From: Kyle Harrison Date: Fri, 23 Jan 2026 16:37:30 +0000 Subject: [PATCH 1/3] ci: ensure that typos are handles during CI --- .pre-commit-config.yaml | 5 +++++ .typos.toml | 11 +++++++++++ CHANGELOG.md | 2 +- cloudsmith_cli/cli/commands/metrics/entitlements.py | 2 +- cloudsmith_cli/cli/commands/metrics/packages.py | 2 +- cloudsmith_cli/cli/config.py | 2 +- cloudsmith_cli/cli/tests/commands/test_repos.py | 6 +++--- cloudsmith_cli/core/ratelimits.py | 2 +- cloudsmith_cli/core/tests/test_init.py | 2 +- 9 files changed, 25 insertions(+), 9 deletions(-) create mode 100644 .typos.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8f7afd69..26eeec70 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,11 @@ # Pre-Commit hooks # See: https://pre-commit.com/hooks.html repos: +- repo: https://github.com/crate-ci/typos + rev: v1.42.0 + hooks: + - id: typos + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 hooks: diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 00000000..bee0c0a0 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,11 @@ +[default.extend-identifiers] +# Proper names - do not correct +Mno-hime = "Mno-hime" + +[default.extend-words] +# Proper names - do not correct +hime = "hime" +McClory = "McClory" +mcclory = "mcclory" +Clory = "Clory" +repositor = "repositor" diff --git a/CHANGELOG.md b/CHANGELOG.md index b07a702f..de4e28fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -114,7 +114,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - Added `--force` parameter to the Auth command to be used in conjunction with `--token` to refresh tokens without interactive prompts i.e automatic. -- Added `--force` parameter to the Tokens refresh command to automaticlly refresh without an interactive prompt. +- Added `--force` parameter to the Tokens refresh command to automatically refresh without an interactive prompt. ## [1.8.5] - 2025-10-16 diff --git a/cloudsmith_cli/cli/commands/metrics/entitlements.py b/cloudsmith_cli/cli/commands/metrics/entitlements.py index 7f627dc3..3a1a8d4e 100644 --- a/cloudsmith_cli/cli/commands/metrics/entitlements.py +++ b/cloudsmith_cli/cli/commands/metrics/entitlements.py @@ -75,7 +75,7 @@ def _print_metrics_table(opts, data): type=str, required=False, help=( - "A comma seperated list of entitlement token identifiers (i.e. slug_perm) or " + "A comma separated list of entitlement token identifiers (i.e. slug_perm) or " "token secrets. If a list is not specified then all entitlement tokens will " "be included for a given namespace or repository." ), diff --git a/cloudsmith_cli/cli/commands/metrics/packages.py b/cloudsmith_cli/cli/commands/metrics/packages.py index 9fa03264..bb7e7053 100644 --- a/cloudsmith_cli/cli/commands/metrics/packages.py +++ b/cloudsmith_cli/cli/commands/metrics/packages.py @@ -74,7 +74,7 @@ def _print_metrics_table(opts, data): type=str, required=False, help=( - "A comma seperated list of package identifiers (i.e. slug_perm). " + "A comma separated list of package identifiers (i.e. slug_perm). " "If a list is not specified then all package will be included for " "a given repository." ), diff --git a/cloudsmith_cli/cli/config.py b/cloudsmith_cli/cli/config.py index e7638f8e..85db7848 100644 --- a/cloudsmith_cli/cli/config.py +++ b/cloudsmith_cli/cli/config.py @@ -95,7 +95,7 @@ def get_storage_name_for(cls, section_name): @classmethod def get_default_filepath(cls): - """Get the default filepath for the configuratin file.""" + """Get the default filepath for the configuration file.""" if not cls.config_files: return None if not cls.config_searchpath: diff --git a/cloudsmith_cli/cli/tests/commands/test_repos.py b/cloudsmith_cli/cli/tests/commands/test_repos.py index 024f5df1..3f6c990b 100644 --- a/cloudsmith_cli/cli/tests/commands/test_repos.py +++ b/cloudsmith_cli/cli/tests/commands/test_repos.py @@ -35,13 +35,13 @@ def parse_table(output): Results: 1 repository visible ``` """ - seperator = "|" + separator = "|" column_headers = [] row_values = [] for line in output.split("\n"): - if seperator in line: - raw_values = [raw_value.strip() for raw_value in line.split(seperator)] + if separator in line: + raw_values = [raw_value.strip() for raw_value in line.split(separator)] if not column_headers: # If we don't have keys yet, then this must be the column headers column_headers = raw_values diff --git a/cloudsmith_cli/core/ratelimits.py b/cloudsmith_cli/core/ratelimits.py index 6cd447fe..77d836a1 100644 --- a/cloudsmith_cli/core/ratelimits.py +++ b/cloudsmith_cli/core/ratelimits.py @@ -40,7 +40,7 @@ def from_dict(cls, data): info.remaining = int(data["remaining"]) if "reset" in data: info.reset = datetime.datetime.utcfromtimestamp(int(data["reset"])) - if "throtted" in data: + if "throttled" in data: info.throttled = bool(data["throttled"]) else: info.throttled = info.remaining == 0 diff --git a/cloudsmith_cli/core/tests/test_init.py b/cloudsmith_cli/core/tests/test_init.py index 229b41ec..1f884dcd 100644 --- a/cloudsmith_cli/core/tests/test_init.py +++ b/cloudsmith_cli/core/tests/test_init.py @@ -58,7 +58,7 @@ def mocked_update_refresh_attempted_at(): class TestInitialiseApi: def setup_class(cls): # pylint: disable=no-self-argument - # For the purposes of these tests, we need to explcitly call set_default(None) at the + # For the purposes of these tests, we need to explicitly call set_default(None) at the # outset because other tests in the suite may have called initialise_api() already. # Resetting Configuration._default to None here effectively reverts the # Configuration class to its vanilla, unmodified behaviour/state. From 91781b198efa93556a437e57b56f37a243409271 Mon Sep 17 00:00:00 2001 From: Kyle Harrison Date: Fri, 23 Jan 2026 16:39:16 +0000 Subject: [PATCH 2/3] docs: adds a pull request template --- .github/PULL_REQUEST_TEMPLATE.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..f68a52bd --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +# Description + + + +## Type of Change + +- [ ] Bug fix +- [ ] New feature +- [ ] Breaking change +- [ ] Documentation update +- [ ] Refactoring +- [ ] Other (please describe) + +## Additional Notes + + From da5f494ae3dfec0bcaa2285bec55a01fd9214db9 Mon Sep 17 00:00:00 2001 From: Kyle Harrison Date: Fri, 23 Jan 2026 16:45:37 +0000 Subject: [PATCH 3/3] ci: adds typos to lint workflow --- .github/workflows/lint.yml | 11 +++++++++++ .pre-commit-config.yaml | 9 +++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 01f1a714..1d9c5f78 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -126,3 +126,14 @@ jobs: - name: Run pylint run: pylint --rcfile=.pylintrc cloudsmith_cli + + typos: + name: Check for typos (typos) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Run typos + uses: crate-ci/typos@65120634e79d8374d1aa2f27e54baa0c364fff5a # v1.42.1 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 26eeec70..9821c3fb 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,10 +1,6 @@ # Pre-Commit hooks # See: https://pre-commit.com/hooks.html repos: -- repo: https://github.com/crate-ci/typos - rev: v1.42.0 - hooks: - - id: typos - repo: https://github.com/pre-commit/pre-commit-hooks rev: v5.0.0 @@ -85,3 +81,8 @@ repos: "-sn", # Don't display the score "--rcfile=.pylintrc", # Link to your config file ] + +- repo: https://github.com/crate-ci/typos + rev: v1.42.1 + hooks: + - id: typos