Skip to content

Commit 7f79da5

Browse files
committed
chore: update pre-commit hooks and linting configurations
1 parent a1de986 commit 7f79da5

File tree

6 files changed

+46
-43
lines changed

6 files changed

+46
-43
lines changed

.github/.env.shared

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,25 @@ SECONDARY_RUNNER=ubuntu-24.04 # Set identical to PRIMARY_RUNNER if you
4040
# ───────────────────────────────────────────────────────────────────────────────
4141
ENABLE_CODE_COVERAGE=true # Enable code coverage reporting (upload to Codecov)
4242
ENABLE_FUZZ_TESTING=true # Enable fuzz running tests (requires Go 1.18+)
43-
ENABLE_LINT=true # Enable linting steps (golangci-lint)
43+
ENABLE_GO_LINT=true # Enable Go code linting steps (golangci-lint)
4444
ENABLE_RACE_DETECTION=true # Enable Go's race detector in tests (-race flag)
4545
ENABLE_SECURITY_SCANS=true # Enable tools like gitleaks, govulncheck, nancy
4646
ENABLE_STATIC_ANALYSIS=true # Enable static analysis jobs (go vet)
47-
ENABLE_VERBOSE_TEST_OUTPUT=true # Enable verbose output for test runs (can slow down CI)
47+
ENABLE_VERBOSE_TEST_OUTPUT=false # Enable verbose output for test runs (can slow down CI)
48+
ENABLE_YAML_LINT=true # Enable YAML format validation (prettier with editorconfig)
4849
MAKEFILE_REQUIRED=true # Enforce the presence of Makefile for builds (future feature)
4950

5051
# ───────────────────────────────────────────────────────────────────────────────
5152
# ENV: Tool Versions & Config
5253
# ───────────────────────────────────────────────────────────────────────────────
5354
GITLEAKS_NOTIFY_USER_LIST=@mrz1836 # User(s) to notify when gitleaks secrets are found (user,user2)
54-
GITLEAKS_VERSION=8.27.2 # Version of gitleaks to install and use (X.Y.Z)
55-
GORELEASER_VERSION=v2.10.2 # Version of goreleaser to install and use (vX.Y.Z)
56-
GOVULNCHECK_VERSION=v1.1.4 # Version of govulncheck to use for Go vuln scanning (vX.Y.Z)
55+
GITLEAKS_VERSION=8.27.2 # Version of gitleaks to install and use (X.Y.Z) (https://github.com/gitleaks/gitleaks)
56+
GORELEASER_VERSION=v2.11.0 # Version of goreleaser to install and use (vX.Y.Z) (https://github.com/goreleaser/goreleaser)
57+
GOVULNCHECK_VERSION=v1.1.4 # Version of govulncheck to use for Go vuln scanning (vX.Y.Z) (https://pkg.go.dev/golang.org/x/vuln)
5758
NANCY_EXCLUDES=CVE-2024-38513,CVE-2022-21698,CVE-2023-45142 # Known acceptable CVEs (cve,cve2,...)
58-
NANCY_VERSION=v1.0.51 # Version of nancy to install and use (vX.Y.Z)
59+
NANCY_VERSION=v1.0.51 # Version of nancy to install and use (vX.Y.Z) (https://github.com/sonatype-nexus-community/nancy)
60+
NODE_VERSION=20 # Node.js version for prettier and other tools (major version)
61+
PRETTIER_VERSION=3.6.2 # Version of prettier to use for YAML validation (X.Y.Z) (https://www.npmjs.com/package/prettier)
5962

6063
# ───────────────────────────────────────────────────────────────────────────────
6164
# ENV: Stale Workflow Configuration

.github/actions/load-env/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
#
1616
# ------------------------------------------------------------------------------------
1717

18-
name: 'Load Environment Variables'
19-
description: 'Loads environment variables from .github/.env.shared and outputs as JSON'
18+
name: "Load Environment Variables"
19+
description: "Loads environment variables from .github/.env.shared and outputs as JSON"
2020

2121
outputs:
2222
env-json:
23-
description: 'JSON object containing all environment variables'
23+
description: "JSON object containing all environment variables"
2424
value: ${{ steps.load-env.outputs.env-json }}
2525
primary-runner:
26-
description: 'Primary runner OS extracted from environment variables'
26+
description: "Primary runner OS extracted from environment variables"
2727
value: ${{ steps.load-env.outputs.primary-runner }}
2828

2929
runs:

.github/actions/warm-cache/action.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,32 @@
88
#
99
# ------------------------------------------------------------------------------------
1010

11-
name: 'Warm Go Caches'
12-
description: 'Warm Go module and build caches for the specified Go version and OS'
11+
name: "Warm Go Caches"
12+
description: "Warm Go module and build caches for the specified Go version and OS"
1313

1414
inputs:
1515
go-version:
16-
description: 'Go version to use'
16+
description: "Go version to use"
1717
required: true
1818
matrix-os:
19-
description: 'Operating system for the runner'
19+
description: "Operating system for the runner"
2020
required: true
2121
matrix-name:
22-
description: 'Display name for the matrix configuration'
22+
description: "Display name for the matrix configuration"
2323
required: true
2424
enable-verbose:
25-
description: 'Enable verbose output'
25+
description: "Enable verbose output"
2626
required: false
27-
default: 'false'
27+
default: "false"
2828
go-primary-version:
29-
description: 'Primary Go version for comparison'
29+
description: "Primary Go version for comparison"
3030
required: true
3131
go-secondary-version:
32-
description: 'Secondary Go version for comparison'
32+
description: "Secondary Go version for comparison"
3333
required: true
3434

3535
runs:
36-
using: 'composite'
36+
using: "composite"
3737
steps:
3838
# ————————————————————————————————————————————————————————————————
3939
# Checkout code, set up Go, and cache dependencies
@@ -59,7 +59,7 @@ runs:
5959
# ────────────────────────────────────────────────────────────────────────────
6060
- name: 💾 Restore Go module cache (shared)
6161
id: gomod-cache
62-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
62+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
6363
with:
6464
path: |
6565
~/go/pkg/mod
@@ -133,7 +133,7 @@ runs:
133133
# ────────────────────────────────────────────────────────────────────────────
134134
- name: 💾 Restore Go build cache (per-version)
135135
id: gobuild-cache
136-
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
136+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
137137
with:
138138
path: |
139139
~/.cache/go-build

.github/dependabot.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ updates:
4747
- "*auth*"
4848
- "*jwt*"
4949
- "*oauth*"
50-
update-types: [ "minor", "patch" ]
50+
update-types: ["minor", "patch"]
5151
open-pull-requests-limit: 10
52-
assignees: [ "galt-tr","mrz1836" ]
53-
labels: [ "chore", "dependencies", "gomod" ]
52+
assignees: ["galt-tr", "mrz1836"]
53+
labels: ["chore", "dependencies", "gomod"]
5454
commit-message:
5555
prefix: "chore"
5656
include: "scope"
@@ -70,10 +70,10 @@ updates:
7070
- dependency-type: "direct"
7171
groups:
7272
ghactions-all:
73-
patterns: [ "*" ]
73+
patterns: ["*"]
7474
open-pull-requests-limit: 10
75-
assignees: [ "galt-tr","mrz1836" ]
76-
labels: [ "chore", "dependencies", "github-actions" ]
75+
assignees: ["galt-tr", "mrz1836"]
76+
labels: ["chore", "dependencies", "github-actions"]
7777
commit-message:
7878
prefix: "chore"
7979
include: "scope"
@@ -93,10 +93,10 @@ updates:
9393
- dependency-type: "direct"
9494
groups:
9595
devcontainer-all:
96-
patterns: [ "*" ]
96+
patterns: ["*"]
9797
open-pull-requests-limit: 5
98-
assignees: [ "galt-tr","mrz1836" ]
99-
labels: [ "chore", "dependencies", "devcontainer" ]
98+
assignees: ["galt-tr", "mrz1836"]
99+
labels: ["chore", "dependencies", "devcontainer"]
100100
commit-message:
101101
prefix: "chore"
102102
include: "scope"

.github/sweep.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
gha_enabled: true
22
branch: master
3-
blocked_dirs: [ ]
3+
blocked_dirs: []
44
draft: false
55
description: |
66
Sweep AI must follow the repository guidelines in .github/AGENTS.md.

.pre-commit-config.yaml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212
# extended with the prefixes listed in AGENTS.md
1313
# ----------------------------------------------------------------------
1414

15-
minimum_pre_commit_version: "3.7.0" # requires Python‑based hooks v2.0+
15+
minimum_pre_commit_version: "3.7.0" # requires Python‑based hooks v2.0+
1616

1717
repos:
1818
# ---------------------- Core hygiene hooks --------------------------
1919
- repo: https://github.com/pre-commit/pre-commit-hooks
20-
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
20+
rev: cef0300fd0fc4d2a87a85fa2093c6b283ea36f4b # frozen: v5.0.0
2121
hooks:
2222
- id: check-added-large-files
2323
- id: end-of-file-fixer
@@ -26,7 +26,7 @@ repos:
2626

2727
# ------------------------- Go toolchain -----------------------------
2828
- repo: https://github.com/TekWizely/pre-commit-golang
29-
rev: 302c7fd28cdbb62d5fd1e3965fe36e33a5f77803 # frozen: v1.0.0-rc.1
29+
rev: 302c7fd28cdbb62d5fd1e3965fe36e33a5f77803 # frozen: v1.0.0-rc.1
3030
hooks:
3131
- id: go-fmt
3232
- id: go-vet
@@ -37,10 +37,10 @@ repos:
3737

3838
# ------------------------ Security scans ---------------------------
3939
- repo: https://github.com/zricethezav/gitleaks
40-
rev: 47218a628da59ef6b24197d15f4b0248ca87f4f0 # frozen: v8.27.2
40+
rev: 47218a628da59ef6b24197d15f4b0248ca87f4f0 # frozen: v8.27.2
4141
hooks:
4242
- id: gitleaks
43-
stages: [ pre-commit, pre-push ]
43+
stages: [pre-commit, pre-push]
4444

4545
# ------------------- Commenting rule enforcement -------------------
4646
- repo: local
@@ -50,25 +50,25 @@ repos:
5050
language: system
5151
entry: |
5252
bash -c 'revive -config .revive.toml ./...'
53-
types: [ go ]
53+
types: [go]
5454
fail_fast: true
5555

5656
- id: comment-conventions
5757
name: "custom comment linter (AGENTS.md)"
5858
language: python
5959
entry: scripts/comment_lint.py
60-
types: [ go, markdown ]
60+
types: [go, markdown]
6161
pass_filenames: true
6262
additional_dependencies:
6363
- regex==2025.6
6464
- ruamel.yaml==0.18
6565

6666
# --------------------- Commit‑msg validation -----------------------
6767
- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
68-
rev: 879f5400493f84c8b683bdeb3366a8439ca17858 # frozen: v9.22.0
68+
rev: 879f5400493f84c8b683bdeb3366a8439ca17858 # frozen: v9.22.0
6969
hooks:
7070
- id: commitlint
71-
stages: [ commit-msg ]
72-
additional_dependencies: [ '@commitlint/config-conventional' ]
71+
stages: [commit-msg]
72+
additional_dependencies: ["@commitlint/config-conventional"]
7373

74-
default_stages: [ pre-commit, pre-push ]
74+
default_stages: [pre-commit, pre-push]

0 commit comments

Comments
 (0)