From 5a04996d99737d80715aa61e042b92b59c1e6258 Mon Sep 17 00:00:00 2001 From: "Arrobo, Gabriel" Date: Tue, 18 Aug 2026 14:50:55 -0700 Subject: [PATCH] Add pre-commit hook for yaml formatting Signed-off-by: Arrobo, Gabriel --- .github/dependabot.yml | 3 -- .github/workflows/main.yml | 9 ---- .github/workflows/push.yml | 6 --- .github/workflows/stale.yml | 2 - .golangci.yml | 1 - .pre-commit-config.yaml | 89 +++++++++++++++++++------------------ 6 files changed, 46 insertions(+), 64 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a7464b3..6760f20 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,12 +1,10 @@ # SPDX-License-Identifier: Apache-2.0 # Copyright 2023 Canonical Ltd. # Copyright 2024 Intel Corporation - # Timeline for each ecosystem is intentionally staggered to spread # Dependabot PRs over the week. version: 2 updates: - - package-ecosystem: "gomod" directory: "/" schedule: @@ -14,7 +12,6 @@ updates: day: "thursday" time: "21:00" timezone: "America/Los_Angeles" - - package-ecosystem: github-actions directory: / schedule: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4a99dd2..13444fd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,6 @@ # Copyright 2023 Canonical Ltd. # Copyright 2025 Intel Corporation name: CI Pipeline - on: pull_request: branches: @@ -10,10 +9,8 @@ on: push: branches: - main - permissions: contents: read - jobs: build: permissions: @@ -25,7 +22,6 @@ jobs: uses: omec-project/.github/.github/workflows/build.yml@c6f69e74f8ee9034dcc237ccbd719de59526aee5 # v0.0.30 with: branch_name: ${{ github.ref }} - static-analysis: permissions: contents: read @@ -36,7 +32,6 @@ jobs: uses: omec-project/.github/.github/workflows/static-analysis.yml@c6f69e74f8ee9034dcc237ccbd719de59526aee5 # v0.0.30 with: branch_name: ${{ github.ref }} - lint: permissions: contents: read @@ -47,7 +42,6 @@ jobs: with: golangci_lint_version: 'v2.11.3' branch_name: ${{ github.ref }} - license-check: permissions: contents: read @@ -56,7 +50,6 @@ jobs: uses: omec-project/.github/.github/workflows/license-check.yml@c6f69e74f8ee9034dcc237ccbd719de59526aee5 # v0.0.30 with: branch_name: ${{ github.ref }} - fossa-scan: permissions: contents: read @@ -66,7 +59,6 @@ jobs: uses: omec-project/.github/.github/workflows/fossa-scan.yml@c6f69e74f8ee9034dcc237ccbd719de59526aee5 # v0.0.30 with: branch_name: ${{ github.ref }} - unit-tests: permissions: contents: read @@ -76,7 +68,6 @@ jobs: uses: omec-project/.github/.github/workflows/unit-test.yml@c6f69e74f8ee9034dcc237ccbd719de59526aee5 # v0.0.30 with: branch_name: ${{ github.ref }} - analysis: if: github.repository_owner == 'omec-project' permissions: diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 356890e..e2818db 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -1,17 +1,14 @@ # SPDX-License-Identifier: Apache-2.0 # Copyright 2024-Present Intel Corporation name: Release Pipeline - on: push: branches: - main paths: - "VERSION" - permissions: contents: read - jobs: tag-github: permissions: @@ -20,7 +17,6 @@ jobs: id-token: write uses: omec-project/.github/.github/workflows/tag-github.yml@c6f69e74f8ee9034dcc237ccbd719de59526aee5 # v0.0.30 secrets: inherit - update-version: needs: tag-github permissions: @@ -33,7 +29,6 @@ jobs: changed: ${{ needs.tag-github.outputs.changed }} version: ${{ needs.tag-github.outputs.version }} secrets: inherit - sbom-source: needs: tag-github permissions: @@ -46,7 +41,6 @@ jobs: artifact_name: ${{ github.event.repository.name }}-${{ needs.tag-github.outputs.version }}.spdx.json sbom_format: spdx-json path: . - grype-scan: needs: [tag-github, sbom-source] permissions: diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 8a77c16..2da1560 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -3,12 +3,10 @@ on: schedule: - cron: "0 0 * * *" - permissions: issues: write pull-requests: write contents: read - jobs: stale: permissions: diff --git a/.golangci.yml b/.golangci.yml index 00c9b44..bf7414f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,6 +1,5 @@ # SPDX-FileCopyrightText: 2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 - version: "2" run: concurrency: 4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 37cbb5d..5ae4e3b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,46 +1,49 @@ # SPDX-FileCopyrightText: 2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 - repos: -- repo: https://github.com/gitleaks/gitleaks - rev: v8.30.1 - hooks: - - id: gitleaks -- repo: local - hooks: - - id: gci - name: gci - entry: gci write - language: golang - types: [go] - additional_dependencies: - - github.com/daixiang0/gci@v0.14.0 - - id: staticcheck - name: staticcheck - entry: staticcheck ./... - language: golang - types: [go] - additional_dependencies: - - honnef.co/go/tools/cmd/staticcheck@v0.7.0 - pass_filenames: false - - id: go-test-race - name: go test -race - entry: go test -race ./... -count=1 - language: system - types: [go] - pass_filenames: false -- repo: https://github.com/golangci/golangci-lint - rev: v2.11.3 - hooks: - - id: golangci-lint-full -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v6.0.0 - hooks: - - id: end-of-file-fixer - - id: trailing-whitespace - args: - - --markdown-linebreak-ext=md -- repo: https://codeberg.org/fsfe/reuse-tool - rev: v6.2.0 - hooks: - - id: reuse + - repo: https://github.com/gitleaks/gitleaks + rev: v8.30.1 + hooks: + - id: gitleaks + - repo: local + hooks: + - id: gci + name: gci + entry: gci write + language: golang + types: [go] + additional_dependencies: + - github.com/daixiang0/gci@v0.14.0 + - id: staticcheck + name: staticcheck + entry: staticcheck ./... + language: golang + types: [go] + additional_dependencies: + - honnef.co/go/tools/cmd/staticcheck@v0.7.0 + pass_filenames: false + - id: go-test-race + name: go test -race + entry: go test -race ./... -count=1 + language: system + types: [go] + pass_filenames: false + - repo: https://github.com/golangci/golangci-lint + rev: v2.11.3 + hooks: + - id: golangci-lint-full + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: end-of-file-fixer + - id: trailing-whitespace + args: + - --markdown-linebreak-ext=md + - repo: https://github.com/google/yamlfmt + rev: v0.21.0 + hooks: + - id: yamlfmt + - repo: https://codeberg.org/fsfe/reuse-tool + rev: v6.2.0 + hooks: + - id: reuse