From 7a201d07c4f3dc6fb2a11b24af4b24be49cbe833 Mon Sep 17 00:00:00 2001 From: actualben Date: Mon, 20 Mar 2023 10:44:58 +0100 Subject: [PATCH 1/3] migrate actionlint into .pre-commit-config.yaml --- .github/workflows/lint.yml | 13 ------------- .pre-commit-config.yaml | 33 +++++++++++++++++++-------------- 2 files changed, 19 insertions(+), 27 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index a0908a8..4c1a2dc 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -7,19 +7,6 @@ name: Lint pull_request: jobs: - actionlint: - runs-on: ubuntu-latest - steps: - # https://github.com/actions/checkout - - name: checkout - uses: actions/checkout@v3 - - # https://github.com/rhysd/actionlint - - name: run actionlint - uses: docker://rhysd/actionlint:latest - with: - args: -color - pre-commit: runs-on: ubuntu-latest steps: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 84f4664..bc305db 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,19 +1,24 @@ repos: -- repo: https://github.com/pre-commit/pre-commit-hooks + - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.4.0 hooks: - - id: check-added-large-files - - id: check-case-conflict - - id: check-merge-conflict - - id: check-symlinks - - id: mixed-line-ending + - id: check-added-large-files + - id: check-case-conflict + - id: check-merge-conflict + - id: check-symlinks + - id: mixed-line-ending args: - - --fix=lf - - id: trailing-whitespace - - id: end-of-file-fixer - - id: check-yaml - - id: detect-private-key - - id: no-commit-to-branch + - --fix=lf + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: detect-private-key + - id: no-commit-to-branch args: - - --branch - - main + - --branch + - main + - repo: https://github.com/rhysd/actionlint + rev: v1.6.23 + hooks: + - id: actionlint-docker + name: check github workflows with actionlint From ed5bb9e0d2959dba08b31c8475b70e1c150f515f Mon Sep 17 00:00:00 2001 From: actualben Date: Thu, 1 May 2025 00:12:35 +0200 Subject: [PATCH 2/3] bump deps, move actionlint into pre-commit-config, minor reformatting --- .github/dependabot.yml | 6 +-- .github/workflows/lint.yml | 26 ++++++------ .pre-commit-config.yaml | 14 +++++- .pre-commit-hooks.yaml | 87 +++++++++++++++++++------------------- .yamllint.yaml | 8 ---- 5 files changed, 72 insertions(+), 69 deletions(-) delete mode 100644 .yamllint.yaml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 68505d6..1658c16 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,7 @@ version: 2 updates: - - package-ecosystem: "github-actions" - directory: "/" + - package-ecosystem: github-actions + directory: / schedule: interval: daily - open-pull-requests-limit: 10 + open-pull-requests-limit: 2 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 4c1a2dc..05b63e2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -2,24 +2,24 @@ name: Lint "on": push: - branches: - - main + branches: [main] pull_request: + branches: [main] jobs: pre-commit: runs-on: ubuntu-latest steps: - # https://github.com/actions/checkout - - name: checkout - uses: actions/checkout@v3 + # https://github.com/actions/checkout + - name: checkout + uses: actions/checkout@v4 - # https://github.com/actions/setup-python - - name: sest up python - uses: actions/setup-python@v4 + # https://github.com/actions/setup-python + - name: sest up python + uses: actions/setup-python@v5 - # https://github.com/pre-commit/action - - name: run pre-commit - uses: pre-commit/action@v3.0.0 - env: - SKIP: no-commit-to-branch + # https://github.com/pre-commit/action + - name: run pre-commit + uses: pre-commit/action@v3.0.1 + env: + SKIP: no-commit-to-branch diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bc305db..0fd2e0b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v5.0.0 hooks: - id: check-added-large-files - id: check-case-conflict @@ -18,7 +18,17 @@ repos: - --branch - main - repo: https://github.com/rhysd/actionlint - rev: v1.6.23 + rev: v1.7.7 hooks: - id: actionlint-docker name: check github workflows with actionlint + - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt + rev: 0.2.3 # or other specific tag + hooks: + - id: yamlfmt + args: + - --mapping=2 + - --sequence=4 + - --offset=2 + - --implicit_start + - --preserve-quotes diff --git a/.pre-commit-hooks.yaml b/.pre-commit-hooks.yaml index 7ceb029..5759c7b 100644 --- a/.pre-commit-hooks.yaml +++ b/.pre-commit-hooks.yaml @@ -1,43 +1,44 @@ -- id: fmt - name: cargo fmt - description: format files with "cargo fmt" - types: - - rust - language: system - entry: cargo fmt - args: - - -- -- id: fmt-check - name: cargo fmt (check-only) - description: check the formatting of source files with "cargo fmt --check" - types: - - rust - language: system - entry: cargo fmt - args: - - --check - - -- -- id: check - name: cargo check - description: check the package for errors with "cargo check" - types: - - rust - language: system - entry: cargo check - pass_filenames: false -- id: clippy - name: cargo clippy - description: check the package with "cargo clippy" - types: - - rust - language: system - entry: cargo clippy - pass_filenames: false -- id: test - name: cargo test - description: run the tests with "cargo test" - types: - - rust - language: system - entry: cargo test - pass_filenames: false + - id: fmt + name: cargo fmt + description: format files with "cargo fmt" + types: + - rust + language: system + entry: cargo fmt + require_serial: true + args: + - -- + - id: fmt-check + name: cargo fmt (check-only) + description: check the formatting of source files with "cargo fmt --check" + types: + - rust + language: system + entry: cargo fmt + args: + - --check + - -- + - id: check + name: cargo check + description: check the package for errors with "cargo check" + types: + - rust + language: system + entry: cargo check + pass_filenames: false + - id: clippy + name: cargo clippy + description: check the package with "cargo clippy" + types: + - rust + language: system + entry: cargo clippy + pass_filenames: false + - id: test + name: cargo test + description: run the tests with "cargo test" + types: + - rust + language: system + entry: cargo test + pass_filenames: false diff --git a/.yamllint.yaml b/.yamllint.yaml deleted file mode 100644 index f339adf..0000000 --- a/.yamllint.yaml +++ /dev/null @@ -1,8 +0,0 @@ -extends: default - -rules: - line-length: disable - comments-indentation: disable - document-start: disable - truthy: - allowed-values: ['true', 'false', 'on'] From 81918eee123e9eb5875100adb46f0326d946bdf2 Mon Sep 17 00:00:00 2001 From: actualben Date: Thu, 1 May 2025 00:56:17 +0200 Subject: [PATCH 3/3] disable pre-commit-hook-yamlfmt for now; minor typo fix --- .github/workflows/lint.yml | 2 +- .pre-commit-config.yaml | 23 +++++++++++++---------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 05b63e2..77cea31 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v4 # https://github.com/actions/setup-python - - name: sest up python + - name: setup python uses: actions/setup-python@v5 # https://github.com/pre-commit/action diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0fd2e0b..a27f338 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,13 +22,16 @@ repos: hooks: - id: actionlint-docker name: check github workflows with actionlint - - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt - rev: 0.2.3 # or other specific tag - hooks: - - id: yamlfmt - args: - - --mapping=2 - - --sequence=4 - - --offset=2 - - --implicit_start - - --preserve-quotes + + # suspending this as of 1-May-2025: I can't get this hook to stop + # over-indenting the entire .pre-commit-hooks.yaml file by 2 spaces + # - repo: https://github.com/jumanjihouse/pre-commit-hook-yamlfmt + # rev: 0.2.3 + # hooks: + # - id: yamlfmt + # args: + # - --mapping=2 + # - --sequence=4 + # - --offset=2 + # - --implicit_start + # - --preserve-quotes