Skip to content

Commit 2c81816

Browse files
committed
Add precious config and run on files
1 parent e6e0f6a commit 2c81816

File tree

7 files changed

+108
-54
lines changed

7 files changed

+108
-54
lines changed

.githooks/pre-commit

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
#
3+
# Git pre-commit hook that runs precious lint on staged files
4+
#
5+
6+
set -e
7+
8+
echo "Running precious lint on staged files..."
9+
10+
# Run precious lint on staged files
11+
if ! precious lint --staged; then
12+
echo ""
13+
echo "❌ Linting failed. Please fix the issues above before committing."
14+
echo ""
15+
echo "To fix formatting issues automatically, run:"
16+
echo " precious tidy --staged"
17+
exit 1
18+
fi
19+
20+
echo "✅ All linters passed!"

.github/dependabot.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
version: 2
22
updates:
3-
- package-ecosystem: gomod
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
time: "13:00"
8-
open-pull-requests-limit: 10
9-
- package-ecosystem: "github-actions"
10-
directory: "/"
11-
schedule:
12-
interval: daily
3+
- package-ecosystem: gomod
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "13:00"
8+
open-pull-requests-limit: 10
9+
- package-ecosystem: "github-actions"
10+
directory: "/"
11+
schedule:
12+
interval: daily

.github/workflows/codeql-analysis.yml

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,55 +3,54 @@ name: "Code scanning - action"
33
on:
44
push:
55
branches-ignore:
6-
- 'dependabot/**'
6+
- "dependabot/**"
77
pull_request:
88
schedule:
9-
- cron: '0 13 * * 4'
9+
- cron: "0 13 * * 4"
1010

1111
permissions:
1212
contents: read
1313
security-events: write
1414

1515
jobs:
1616
CodeQL-Build:
17-
1817
runs-on: ubuntu-latest
1918

2019
steps:
21-
- name: Checkout repository
22-
uses: actions/checkout@v6
23-
with:
24-
# We must fetch at least the immediate parents so that if this is
25-
# a pull request then we can checkout the head.
26-
fetch-depth: 2
27-
28-
# If this run was triggered by a pull request event, then checkout
29-
# the head of the pull request instead of the merge commit.
30-
- run: git checkout HEAD^2
31-
if: ${{ github.event_name == 'pull_request' }}
32-
33-
# Initializes the CodeQL tools for scanning.
34-
- name: Initialize CodeQL
35-
uses: github/codeql-action/init@v4
36-
# Override language selection by uncommenting this and choosing your languages
37-
# with:
38-
# languages: go, javascript, csharp, python, cpp, java
39-
40-
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
41-
# If this step fails, then you should remove it and run the build manually (see below)
42-
- name: Autobuild
43-
uses: github/codeql-action/autobuild@v4
44-
45-
# ℹ️ Command-line programs to run using the OS shell.
46-
# 📚 https://git.io/JvXDl
47-
48-
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
49-
# and modify them (or add more) to build your code if your project
50-
# uses a compiled language
51-
52-
#- run: |
53-
# make bootstrap
54-
# make release
55-
56-
- name: Perform CodeQL Analysis
57-
uses: github/codeql-action/analyze@v4
20+
- name: Checkout repository
21+
uses: actions/checkout@v6
22+
with:
23+
# We must fetch at least the immediate parents so that if this is
24+
# a pull request then we can checkout the head.
25+
fetch-depth: 2
26+
27+
# If this run was triggered by a pull request event, then checkout
28+
# the head of the pull request instead of the merge commit.
29+
- run: git checkout HEAD^2
30+
if: ${{ github.event_name == 'pull_request' }}
31+
32+
# Initializes the CodeQL tools for scanning.
33+
- name: Initialize CodeQL
34+
uses: github/codeql-action/init@v4
35+
# Override language selection by uncommenting this and choosing your languages
36+
# with:
37+
# languages: go, javascript, csharp, python, cpp, java
38+
39+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
40+
# If this step fails, then you should remove it and run the build manually (see below)
41+
- name: Autobuild
42+
uses: github/codeql-action/autobuild@v4
43+
44+
# ℹ️ Command-line programs to run using the OS shell.
45+
# 📚 https://git.io/JvXDl
46+
47+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
48+
# and modify them (or add more) to build your code if your project
49+
# uses a compiled language
50+
51+
#- run: |
52+
# make bootstrap
53+
# make release
54+
55+
- name: Perform CodeQL Analysis
56+
uses: github/codeql-action/analyze@v4

.github/workflows/go.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ permissions:
66
contents: read
77

88
jobs:
9-
109
build:
1110
name: Build
1211
strategy:

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ linters:
157157
- govet
158158
- revive
159159
path: _test.go
160-
text: 'fieldalignment:'
160+
text: "fieldalignment:"
161161
formatters:
162162
enable:
163163
- gci

.precious.toml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
exclude = [
2+
"test-data/**/*",
3+
"vendor/**/*",
4+
]
5+
6+
[commands.golangci-lint-fmt]
7+
type = "both"
8+
include = "**/*.go"
9+
invoke = "once"
10+
path-args = "none"
11+
cmd = ["golangci-lint", "fmt"]
12+
lint-flags = "--diff"
13+
ok-exit-codes = [0]
14+
lint-failure-exit-codes = [1]
15+
16+
[commands.golangci-lint]
17+
type = "both"
18+
include = "**/*.go"
19+
invoke = "once"
20+
path-args = "none"
21+
cmd = ["golangci-lint", "run"]
22+
tidy-flags = "--fix"
23+
ok-exit-codes = [0]
24+
lint-failure-exit-codes = [1]
25+
26+
[commands.prettier]
27+
type = "both"
28+
include = ["**/*.md", "**/*.yml", "**/*.yaml"]
29+
invoke = "once"
30+
path-args = "file"
31+
cmd = ["prettier"]
32+
lint-flags = "--check"
33+
tidy-flags = "--write"
34+
ok-exit-codes = [0]
35+
lint-failure-exit-codes = [1]
36+
expect-stderr = true

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@
5959

6060
## 2.0.0-beta.7 - 2025-07-07
6161

62-
* Update capitalization of "uint" in `ReadUInt*` to match `KindUint*` as well
62+
- Update capitalization of "uint" in `ReadUInt*` to match `KindUint*` as well
6363
as the Go standard library.
6464

6565
## 2.0.0-beta.6 - 2025-07-07
6666

67-
* Invalid release with no code changes.
67+
- Invalid release with no code changes.
6868

6969
## 2.0.0-beta.5 - 2025-07-06
7070

0 commit comments

Comments
 (0)