Skip to content

Commit ca5ee05

Browse files
Update project from template
1 parent 8fd7126 commit ca5ee05

File tree

15 files changed

+59
-48
lines changed

15 files changed

+59
-48
lines changed

.gitattributes

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
# Auto detect text files and perform LF normalization
22
* text=auto
3+
4+
# Force LF even on windows for testdata, means comparisons don't fail just
5+
# because of line endings
6+
**/testdata/* text eol=lf
7+
8+
# Txtar requires lf
9+
*.txtar text eol=lf

.github/renovate.json

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": ["config:recommended"],
4-
"labels": ["dependencies"],
5-
"postUpdateOptions": ["gomodTidy"],
6-
"packageRules": [{ "matchManagers": ["golang-version"] }]
7-
}
3+
"extends": [
4+
"config:recommended"
5+
],
6+
"labels": [
7+
"dependencies"
8+
],
9+
"postUpdateOptions": [
10+
"gomodTidy"
11+
]
12+
}

.gitignore

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,linux,visualstudiocode,jetbrains+all,go
2-
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,linux,visualstudiocode,jetbrains+all,go
1+
# Created by https://www.toptal.com/developers/gitignore/api/macos,windows,linux,visualstudiocode,goland+all,go
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,windows,linux,visualstudiocode,goland+all,go
33

44
### Go ###
55
# If you prefer the allow list template instead of the deny list, see community template:
@@ -17,22 +17,15 @@
1717

1818
# Output of the go coverage tool, specifically when used with LiteIDE
1919
*.out
20-
coverage.html
21-
22-
# Taskfile
23-
.task
24-
25-
# Comparative benchmarks
26-
before.txt
27-
after.txt
2820

2921
# Dependency directories (remove the comment below to include it)
3022
# vendor/
3123

32-
# Go workspace file
24+
# Go workspace files
3325
go.work
26+
go.work.sum
3427

35-
### JetBrains+all ###
28+
### GoLand+all ###
3629
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
3730
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
3831

@@ -111,7 +104,7 @@ fabric.properties
111104
# Android studio 3.1+ serialized cache file
112105
.idea/caches/build_file_checksums.ser
113106

114-
### JetBrains+all Patch ###
107+
### GoLand+all Patch ###
115108
# Ignore everything but code style settings and run configurations
116109
# that are supposed to be shared within teams.
117110

@@ -170,7 +163,7 @@ Temporary Items
170163

171164
### VisualStudioCode ###
172165
.vscode/*
173-
!.vscode/settings.json
166+
# !.vscode/settings.json
174167
!.vscode/tasks.json
175168
!.vscode/launch.json
176169
!.vscode/extensions.json
@@ -213,4 +206,12 @@ $RECYCLE.BIN/
213206
# Windows shortcuts
214207
*.lnk
215208

216-
# End of https://www.toptal.com/developers/gitignore/api/macos,windows,linux,visualstudiocode,jetbrains+all,go
209+
# End of https://www.toptal.com/developers/gitignore/api/macos,windows,linux,visualstudiocode,goland+all,go
210+
211+
# Zed editor
212+
.zed/*
213+
# !.zed/settings.json
214+
!.zed/tasks.json
215+
216+
# Taskfile
217+
.task/

.golangci.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ formatters:
1111
extra-rules: true
1212

1313
golines:
14-
max-len: 140
14+
max-len: 120
1515

1616
linters:
1717
default: all
@@ -25,7 +25,6 @@ linters:
2525
- funlen # Bad metric for complexity
2626
- ginkgolinter # I don't use whatever this is
2727
- gochecknoglobals # Globals are fine sometimes, use common sense
28-
- gocognit # Cmplexity with another name, don't need both
2928
- gocyclo # cyclop does this instead
3029
- godox # "todo" and "fixme" comments are allowed
3130
- goheader # No need
@@ -42,21 +41,19 @@ linters:
4241
- unparam # gopls is better and more subtle
4342
- varnamelen # Lots of false positives of things that are fine
4443
- wrapcheck # Not every error must be wrapped
45-
- wsl # Very aggressive, some of this I like but tend to do anyway
46-
- wsl_v5 # As above, just newer version
44+
- wsl # Deprecated
4745

4846
exclusions:
4947
presets:
5048
# See https://golangci-lint.run/usage/false-positives/#exclusion-presets
51-
- comments # Revive in particular has lots of false positives
5249
- std-error-handling
5350
- common-false-positives
5451
rules:
5552
- path: _test\.go
5653
linters:
5754
- prealloc # These kinds of optimisations will make no difference to test code
5855
- gosec # Tests don't need security stuff
59-
56+
- goconst # Sometimes repetition is okay in tests
6057
paths:
6158
- internal/diff
6259

@@ -158,11 +155,7 @@ linters:
158155
disabled: true # predeclared does this
159156

160157
- name: unhandled-error
161-
arguments:
162-
- fmt\.(Fp|P)rint(ln|f)?
163-
- strings.Builder.Write(String|Byte)?
164-
- bytes.Buffer.Write(String|Byte)?
165-
- go/printer.(Fp|P)rint(ln|f)?
158+
disabled: true # errcheck handles this
166159

167160
- name: flag-parameter
168161
disabled: true # As far as I can work out this just doesn't like bools

.mailmap

Lines changed: 0 additions & 1 deletion
This file was deleted.

.typos.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
[default.extend-words]
2+
byt = "byt" # Useful name as byte is a keyword in go
23
decorder = "decorder" # Name of a Go linter
4+
5+
[files]
6+
extend-exclude = ["go.mod", "go.sum"]

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
21
MIT License
32

4-
Copyright (c) 2024, Tom Fleet
3+
Copyright (c) 2025, Tom Fleet
54

65
Permission is hereby granted, free of charge, to any person obtaining a copy
76
of this software and associated documentation files (the "Software"), to deal
@@ -20,3 +19,4 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2019
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2120
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2221
SOFTWARE.
22+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Snapshot
22

33
<p align="center">
4-
<img src="https://github.com/FollowTheProcess/snapshot/raw/main/img/logo.jpg" alt="logo" width=75%>
4+
<img src="https://github.com/FollowTheProcess/snapshot/raw/main/docs/img/logo.jpg" alt="logo" width=75%>
55
</p>
66

77
[![License](https://img.shields.io/github/license/FollowTheProcess/snapshot)](https://github.com/FollowTheProcess/snapshot)

Taskfile.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,21 @@ tasks:
2525
desc: Run go fmt on all source files
2626
sources:
2727
- "**/*.go"
28-
- .golangci.yml
2928
cmds:
30-
- golangci-lint fmt
29+
- go fmt ./...
3130

3231
test:
3332
desc: Run the test suite
3433
sources:
3534
- "**/*.go"
35+
- go.mod
36+
- go.sum
37+
- "**/testdata/**/*"
38+
env:
39+
# -race needs CGO (https://go.dev/doc/articles/race_detector#Requirements)
40+
CGO_ENABLED: 1
3641
cmds:
37-
- go test -race -cover ./... {{ .CLI_ARGS }}
42+
- go test -race ./... {{ .CLI_ARGS }}
3843

3944
bench:
4045
desc: Run all project benchmarks
@@ -44,12 +49,10 @@ tasks:
4449
- go test ./... -run None -benchmem -bench . {{ .CLI_ARGS }}
4550

4651
lint:
47-
desc: Run the linters and auto-fix if possible
52+
desc: Run linting
4853
sources:
4954
- "**/*.go"
5055
- .golangci.yml
51-
deps:
52-
- fmt
5356
preconditions:
5457
- sh: command -v golangci-lint
5558
msg: golangci-lint not installed, see https://golangci-lint.run/usage/install/#local-installation
@@ -62,11 +65,11 @@ tasks:
6265

6366
doc:
6467
desc: Render the pkg docs locally
65-
cmds:
66-
- pkgsite -open
6768
preconditions:
6869
- sh: command -v pkgsite
6970
msg: pkgsite not installed, run `go install golang.org/x/pkgsite/cmd/pkgsite@latest`
71+
cmds:
72+
- pkgsite -open
7073

7174
cov:
7275
desc: Calculate test coverage and render the html

0 commit comments

Comments
 (0)