Skip to content

Commit b61b615

Browse files
committed
1. Refactoring EditorConfig & golangci config
2. Updated dependency versions
1 parent e83db83 commit b61b615

File tree

8 files changed

+67
-40
lines changed

8 files changed

+67
-40
lines changed

.editorconfig

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,15 @@ indent_size = tab
77
indent_style = tab
88
insert_final_newline = true
99
tab_width = 4
10+
max_line_length = 150
11+
# https://www.jetbrains.com/help/idea/editorconfig.html
1012
ij_smart_tabs = true
1113
ij_continuation_indent_size = 4
12-
max_line_length = 150
1314
ij_visual_guides = 80, 120
1415
ij_formatter_tags_enabled = true
1516
ij_formatter_on_tag = @formatter:on
1617
ij_formatter_off_tag = @formatter:off
1718

18-
[*.json]
19-
ij_json_keep_indents_on_empty_lines = false
20-
ij_json_keep_line_breaks = false
21-
ij_json_wrap_long_lines = false
22-
23-
[{.env,.env.*}]
24-
ij_wrap_on_typing = false
25-
26-
[*.proto]
27-
ij_protobuf_blank_lines_after_imports = 1
28-
ij_protobuf_blank_lines_after_package = 1
29-
ij_protobuf_keep_indents_on_empty_lines = false
30-
ij_protobuf_spaces_around_assignment_operators = true
31-
3219
[*.go]
3320
ij_go_add_leading_space_to_comments = true
3421

@@ -44,12 +31,21 @@ ij_go_run_go_fmt_on_reformat = true
4431
ij_go_call_parameters_wrap = on_every_item
4532

4633
[*.yml]
34+
indent_size = 2
35+
indent_style = space
4736
tab_width = 2
4837
ij_wrap_on_typing = false
4938
ij_yaml_keep_indents_on_empty_lines = false
5039

5140
[.idea/**.xml]
41+
indent_size = 2
42+
indent_style = space
43+
tab_width = 2
44+
ij_xml_space_inside_empty_tag = true
5245
insert_final_newline = false
5346

5447
[Makefile]
5548
ij_wrap_on_typing = false
49+
50+
[{LICENSE,*.adoc}]
51+
max_line_length = off

.github/workflows/dependency-review.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# Dependency Review Action
2-
#
3-
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
4-
#
5-
# Source repository: https://github.com/actions/dependency-review-action
6-
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
71
name: 'Dependency Review'
82
on: [pull_request]
93

.github/workflows/lint.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: lint & diff
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
test-gomod:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-go@v5
13+
with:
14+
go-version: 'stable'
15+
- run: go mod tidy && git diff --exit-code go.mod go.sum
16+
17+
test-generate:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- uses: actions/setup-go@v5
23+
with:
24+
go-version: 'stable'
25+
check-latest: true
26+
27+
- run: make go-dependencies
28+
29+
- run: make go-generate && git diff --exit-code
30+
31+
editorconfig:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v4
35+
- uses: editorconfig-checker/action-editorconfig-checker@main
36+
- run: editorconfig-checker

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727
check-latest: true
2828

2929
- run: make go-dependencies
30-
- run: make go-generate && git diff --exit-code
3130
- run: make go-all-tests
3231

3332
- name: Test Summary

.golangci.yml

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,57 +7,56 @@ run:
77
linters:
88
disable-all: true
99
enable:
10-
- errcheck
11-
- gosimple
12-
- govet
13-
- ineffassign
14-
- staticcheck
15-
- unused
1610
- asasalint
1711
- bodyclose
1812
- containedctx
1913
- contextcheck
2014
- cyclop
2115
- dogsled
16+
- err113
17+
- errcheck
2218
- errname
2319
- errorlint
2420
- exhaustive
2521
- exportloopref
2622
- forbidigo
2723
- funlen
24+
- ginkgolinter
2825
- gocritic
2926
- gocyclo
30-
- err113
3127
- goimports
32-
- mnd
3328
- gomoddirectives
3429
- gosec
30+
- gosimple
3531
- govet
3632
- grouper
33+
- ineffassign
34+
- interfacebloat
3735
- misspell
36+
- mnd
3837
- nilerr
38+
- nilnil
3939
- nlreturn
4040
- noctx
4141
- prealloc
4242
- predeclared
4343
- promlinter
4444
- revive
45-
- wastedassign
45+
- sloglint
46+
- staticcheck
4647
- tagliatelle
4748
- tenv
4849
- testpackage
4950
- typecheck
5051
- unconvert
5152
- unparam
53+
- unused
5254
- usestdlibvars
5355
- varnamelen
56+
- wastedassign
5457
- whitespace
5558
- wrapcheck
5659
- wsl
57-
- ginkgolinter
58-
- interfacebloat
59-
- sloglint
60-
- nilnil
6160

6261
linters-settings:
6362
varnamelen:

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ go-dependencies:
55
$(eval GOBIN=$(shell go env GOPATH 2>/dev/null)/bin)
66
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GOBIN) latest
77
#
8+
go install github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@latest
9+
#
810
go install github.com/onsi/ginkgo/v2/ginkgo@latest
911

1012
go-update: go-dependencies
@@ -15,6 +17,7 @@ go-generate:
1517
$(MAKE) go-update
1618

1719
go-lint:
20+
editorconfig-checker
1821
golangci-lint run
1922

2023
go-unit-tests:

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require (
1616
github.com/go-logr/logr v1.4.2 // indirect
1717
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
1818
github.com/google/go-cmp v0.6.0 // indirect
19-
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect
19+
github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25 // indirect
2020
github.com/jackc/pgpassfile v1.0.0 // indirect
2121
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect
2222
github.com/jackc/pgx/v5 v5.6.0 // indirect

go.sum

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1v
1212
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
1313
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
1414
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
15-
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA=
16-
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
15+
github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25 h1:sEDPKUw6iPjczdu33njxFjO6tYa9bfc0z/QyB/zSsBw=
16+
github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
1717
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
1818
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
1919
github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 h1:iCEnooe7UlwOQYpKFhBabPMi4aNAfoODPEFNiAnClxo=
@@ -31,8 +31,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
3131
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
3232
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
3333
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
34-
github.com/onsi/ginkgo/v2 v2.20.1 h1:YlVIbqct+ZmnEph770q9Q7NVAz4wwIiVNahee6JyUzo=
35-
github.com/onsi/ginkgo/v2 v2.20.1/go.mod h1:lG9ey2Z29hR41WMVthyJBGUBcBhGOtoPF2VFMvBXFCI=
34+
github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4=
35+
github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag=
3636
github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8=
3737
github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc=
3838
github.com/orandin/slog-gorm v1.4.0 h1:FgA8hJufF9/jeNSYoEXmHPPBwET2gwlF3B85JdpsTUU=

0 commit comments

Comments
 (0)