Skip to content

Commit 3c70fd7

Browse files
committed
chore: replace pre-commit with just lint command
Replaced .pre-commit-config.yaml with a 'just lint' command that performs the same checks: - Ruff formatting and linting (Python code) - Terraform/OpenTofu formatting and validation - RST backtick syntax checking Added lint job to PR validation workflow that runs before other checks. This simplifies the development workflow by using just commands instead of requiring pre-commit hooks to be installed.
1 parent 7df9144 commit 3c70fd7

File tree

3 files changed

+43
-34
lines changed

3 files changed

+43
-34
lines changed

.github/workflows/pr.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@ on:
1111
- main
1212

1313
jobs:
14+
lint:
15+
name: Lint
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
20+
with:
21+
persist-credentials: false
22+
23+
- name: Set up dependencies
24+
run: just setup-gha
25+
26+
- name: Run lint checks
27+
run: just lint
28+
1429
zizmor:
1530
name: Zizmor
1631
runs-on: ubuntu-latest

.pre-commit-config.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.

justfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,32 @@ check-feeds:
111111
fi
112112
fi
113113

114+
# Linting tasks (replaces pre-commit hooks)
115+
lint-ruff:
116+
uv run ruff check .
117+
uv run ruff format --check .
118+
119+
lint-terraform:
120+
#!/usr/bin/env bash
121+
# Skip if no .tf files exist
122+
if ! find . -name "*.tf" -not -path "./.terraform/*" -type f | grep -q .; then
123+
echo "No Terraform files found, skipping terraform checks"
124+
exit 0
125+
fi
126+
tofu fmt -check -recursive .
127+
tofu validate
128+
129+
lint-rst:
130+
#!/usr/bin/env bash
131+
# Check for common RST mistakes (backticks without role) in .rst files only
132+
# Exclude plugins/ and Just-Read/ directories
133+
if find . -name "*.rst" -not -path "./plugins/*" -not -path "./Just-Read/*" -not -path "./.venv/*" -type f -exec grep -l -E '\`[^\`]+\`[^_]' {} \; 2>/dev/null | grep -q .; then
134+
echo "Found bare backticks in RST files (should use :role:\`text\` or \`\`double backticks\`\`)"
135+
find . -name "*.rst" -not -path "./plugins/*" -not -path "./Just-Read/*" -not -path "./.venv/*" -type f -exec grep -Hn -E '\`[^\`]+\`[^_]' {} \;
136+
exit 1
137+
fi
138+
echo "RST backtick check passed"
139+
140+
lint: lint-ruff lint-terraform lint-rst
141+
114142
check: check-code check-content check-links check-html check-feeds

0 commit comments

Comments
 (0)