diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..f5fff64 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,4 @@ +--- +exclude_paths: + - .cache/ # implicit unless exclude_paths is defined in config + - mkdocs.yml # https://github.com/ansible/ansible-lint/issues/4222 diff --git a/.config/dictionary.txt b/.config/dictionary.txt new file mode 100644 index 0000000..d3a22bf --- /dev/null +++ b/.config/dictionary.txt @@ -0,0 +1,64 @@ +Fosstodon +PYTHONBREAKPOINT +PYTHONHASHSEED +PYTHONHTTPSVERIFY +PYTHONIOENCODING +PYTHONPYCACHEPREFIX +REQPASS +Sbarnea +Sorin +autorefs +basepython +cairosvg +codenotify +codespell +configfile +cookiecutter +devel +diskcache +distros +envdir +envlist +envname +facelessuser +fontawesome +gerrit +gitreview +hashseed +htmlproofer +inlinehilite +linejoin +linenums +magiclink +markdownlint +minversion +mkdocs +newhostkey +nocows +nosetests +notest +noxfile +outdir +passenv +pipdeptree +pluggy +posargs +programdata +protobuf +pymdown +pymdownx +pypa +pypackage +setenv +showconfig +showlocals +ssbarnea +superfences +taskfile +taskfiles +testenv +toxenv +toxinidir +typer +typeshed +usedevelop diff --git a/.github/dependabot.yml b/.github/dependabot.yml index e371e48..77551be 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -13,10 +13,10 @@ updates: dependencies: patterns: - "*" - - package-ecosystem: "github-actions" - directory: "/" + - package-ecosystem: github-actions + directory: / schedule: interval: daily labels: - - "dependencies" - - "skip-changelog" + - dependencies + - skip-changelog diff --git a/.github/workflows/ack.yml b/.github/workflows/ack.yml index e244e3b..0501344 100644 --- a/.github/workflows/ack.yml +++ b/.github/workflows/ack.yml @@ -4,7 +4,6 @@ name: ack on: pull_request_target: types: [opened, labeled, unlabeled, synchronize] - jobs: ack: uses: ansible/team-devtools/.github/workflows/ack.yml@main diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 029b3a8..a3a2b15 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -5,8 +5,8 @@ on: push: branches: - main - - "releases/**" - - "stable/**" + - releases/** + - stable/** jobs: ack: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 22a15bf..7f47f33 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,7 +4,6 @@ name: release on: release: types: [published] - jobs: pypi: name: Publish to PyPI registry diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index abbe8a6..53a7c7a 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -4,10 +4,10 @@ name: tox on: push: # only publishes pushes to the main branch to TestPyPI branches: # any integration branch but not tag - - "main" + - main pull_request: branches: - - "main" + - main concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} @@ -105,8 +105,7 @@ jobs: printf '### Failed as git reported modified and/or untracked files\n```\n%s\n```\n' "$(git status -s)" | tee -a "$GITHUB_STEP_SUMMARY" exit 99 fi - # https://github.com/actions/toolkit/issues/193 - + # https://github.com/actions/toolkit/issues/193 check: # This job does nothing and is only used for the branch protection if: always() permissions: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dbec4b5..37ace9d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,14 +1,16 @@ --- ci: - skip: [markdownlint_docker] + skip: + - markdownlint_docker repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.9" + rev: v0.4.9 hooks: - id: ruff - args: [--fix, --exit-non-zero-on-fix] + args: + - --fix + - --exit-non-zero-on-fix - repo: https://github.com/pre-commit/mirrors-prettier - # keep it before yamllint rev: v4.0.0-alpha.8 hooks: - id: prettier @@ -17,6 +19,14 @@ repos: - prettier - prettier-plugin-toml - prettier-plugin-sort-json + - repo: https://github.com/streetsidesoftware/cspell-cli + rev: v8.8.2 + hooks: + - id: cspell + # entry: codespell --relative + args: [--relative, --no-progress, --no-summary] + name: Spell check with cspell + - repo: https://github.com/markdownlint/markdownlint.git rev: v0.12.0 hooks: @@ -25,7 +35,8 @@ repos: rev: 24.4.2 hooks: - id: black - args: [--safe] + args: + - --safe - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.6.0 hooks: @@ -37,19 +48,25 @@ repos: - id: check-merge-conflict - id: debug-statements language_version: python3 + - repo: https://github.com/ansible/ansible-lint + rev: v24.6.0 + hooks: + - id: ansible-lint + args: [--fix] - repo: https://github.com/adrienverge/yamllint.git rev: v1.35.1 hooks: - id: yamllint files: \.(yaml|yml)$ - types: [file, yaml] + types: + - file + - yaml entry: yamllint --strict - repo: https://github.com/pre-commit/mirrors-mypy rev: v1.10.0 hooks: - id: mypy - # mypy args needed in order to match mypy cli behavior - args: ["--python-version", "3.10"] + args: [--python-version, "3.10"] entry: mypy src/ pass_filenames: false additional_dependencies: diff --git a/.yamllint b/.yamllint index 6f1bdc4..7ca369a 100644 --- a/.yamllint +++ b/.yamllint @@ -13,6 +13,7 @@ rules: comments: # prettier compatibility min-spaces-from-content: 1 + comments-indentation: false document-start: present: true line-length: disable @@ -20,4 +21,4 @@ rules: forbid-implicit-octal: true forbid-explicit-octal: true truthy: - allowed-values: ['true', 'false', 'on'] + check-keys: false diff --git a/cspell.config.yaml b/cspell.config.yaml new file mode 100644 index 0000000..72a9602 --- /dev/null +++ b/cspell.config.yaml @@ -0,0 +1,21 @@ +--- +dictionaryDefinitions: + - name: words + path: .config/dictionary.txt + addWords: true +dictionaries: + # Use `cspell-cli trace word` to check where a work is defined + - en_US + - bash + - words + - python + - python-common +ignorePaths: + - cspell.config.yaml + # The requirements file + - .config/constraints.txt + - ./samples/integration/*.* + - .config/requirements.txt + - .config/requirements.in + # Other + - "*.svg" diff --git a/mkdocs.yml b/mkdocs.yml index 9e7807a..e727c72 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -11,7 +11,7 @@ extra_css: - stylesheets/extra.css theme: - name: "material" + name: material custom_dir: docs/.overrides logo: images/logo.svg favicon: images/favicon.ico diff --git a/playbooks/example-playbook.yml b/playbooks/example-playbook.yml index 43d1fea..80708b1 100644 --- a/playbooks/example-playbook.yml +++ b/playbooks/example-playbook.yml @@ -1,2 +1,3 @@ --- -- hosts: localhost +- name: Empty playbook + hosts: localhost diff --git a/playbooks/test-integration.yml b/playbooks/test-integration.yml index baa30df..355c046 100644 --- a/playbooks/test-integration.yml +++ b/playbooks/test-integration.yml @@ -26,7 +26,7 @@ ansible.builtin.debug: msg: Using {{ cache_dir }} for temporary files - - name: Clone repo # noqa: git-latest + - name: Clone repo # noqa: latest[git] ansible.builtin.git: accept_newhostkey: true repo: "{{ item.url }}" @@ -55,9 +55,7 @@ args: chdir: "{{ (cache_dir, item.name) | path_join }}" vars: - output_dir: - "{{ (playbook_dir, '..', 'samples', 'integration') | path_join | - realpath }}" + output_dir: "{{ (playbook_dir, '..', 'samples', 'integration') | path_join | realpath }}" register: result loop: "{{ repos }}" changed_when: false diff --git a/src/mk/tools/git.py b/src/mk/tools/git.py index d48fb43..1a6b8b2 100644 --- a/src/mk/tools/git.py +++ b/src/mk/tools/git.py @@ -77,7 +77,7 @@ def up(self): fail("Failed to create upstream") if tracking_branch is None: - logging.debug("We do not have atracking branch") + logging.debug("We do not have a tracking branch") else: logging.debug("Performing a git push") @@ -91,7 +91,7 @@ def up(self): # https://github.com/cli/cli/issues/1718 # --web option is of not use because it happens too soon, confusing github - logging.debug("Tryging to detect if there are existing PRs open") + logging.debug("Trying to detect if there are existing PRs open") result = run_or_fail( ["gh", "pr", "list", "-S", f"head:{repo.active_branch}"], )