Skip to content

Commit 38e68c3

Browse files
authored
chore: add dependabot, codespell (#12)
1 parent 1923cf6 commit 38e68c3

File tree

7 files changed

+38
-9
lines changed

7 files changed

+38
-9
lines changed

.githooks/pre-commit

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ if (git diff --cached --name-only | grep --silent '\.go$'); then
66
make generate
77
git add *_string.go
88

9+
make spell
10+
if [ $? -ne 0 ]; then
11+
echo "codespell found issues. Please fix them before committing. Commit aborted."
12+
exit 1
13+
fi
14+
915
make lint
1016
if [ $? -ne 0 ]; then
1117
echo "golangci-lint failed. You can try 'make fix' to automatically fix some issues. Commit aborted."

.github/dependabot.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
8+
- package-ecosystem: "gomod"
9+
directory: "/"
10+
schedule:
11+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
name: CI
1+
name: ci
2+
3+
env:
4+
go-version: 1.24.4
25

36
on:
47
pull_request:
@@ -10,28 +13,33 @@ on:
1013
- '.github/workflows/ci.yml'
1114

1215
jobs:
16+
1317
golangci-lint:
14-
name: lint
1518
runs-on: ubuntu-latest
1619
steps:
1720
- uses: actions/checkout@v5
1821
- uses: actions/setup-go@v6
1922
with:
20-
go-version: 1.24.4
23+
go-version: ${{ env.go-version }}
2124
- name: Install libpcap-dev
2225
run: sudo apt-get update && sudo apt-get install -y libpcap-dev
2326
- uses: golangci/golangci-lint-action@v8
2427
with:
2528
version: v2.5.0
2629

30+
codespell:
31+
runs-on: ubuntu-latest
32+
steps:
33+
- uses: actions/checkout@v6
34+
- uses: codespell-project/actions-codespell@v2
35+
2736
test:
28-
name: test
2937
runs-on: ubuntu-latest
3038
steps:
3139
- uses: actions/checkout@v5
3240
- uses: actions/setup-go@v6
3341
with:
34-
go-version: 1.24.4
42+
go-version: ${{ env.go-version }}
3543
- name: Install libpcap-dev
3644
run: sudo apt-get update && sudo apt-get install -y libpcap-dev
3745
- name: Download Go modules

.github/workflows/release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ permissions:
1010
issues: write
1111

1212
jobs:
13-
release:
14-
name: Run release-please
13+
release-please:
1514
runs-on: ubuntu-latest
1615
steps:
1716
- uses: actions/checkout@v5

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ fix: generate
2121
lint: generate
2222
golangci-lint run ./...
2323

24+
spell:
25+
codespell .
26+
27+
check: lint spell
28+
2429
test: generate
2530
CGO_ENABLED=1 go test ./dnp3 -v -args -pcaps=opendnp3_test1.pcap
2631

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ go test ./dnp3 -args -print
4444
### Linting
4545
[`golangci-lint`](https://golangci-lint.run/) is used for lint and format checking. Run `make lint` to check for errors, and `make fix` to try to automatically fix linting or formatting errors.
4646

47-
## Implemenation
47+
## Implementation
4848

4949
Based on Wireshark's parser and publicly available documents (such as [this validation guide](https://www.dnp.org/Portals/0/Public%20Documents/DNP3%20AN2013-004b%20Validation%20of%20Incoming%20DNP3%20Data.pdf)), as access to the official DNP3 specification is restricted.

dnp3/response.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ const (
115115
AuthenticationResponse
116116
)
117117

118-
// ApplicationInternalIndications - information about outstation sate.
118+
// ApplicationInternalIndications - information about outstation state.
119119
type ApplicationInternalIndications struct {
120120
// IIN 1
121121
AllStations bool `json:"all_stations"`

0 commit comments

Comments
 (0)