Skip to content

Commit 2649517

Browse files
committed
Refactoring
1 parent 1b7b77e commit 2649517

File tree

4 files changed

+22
-20
lines changed

4 files changed

+22
-20
lines changed

.golangci.next.reference.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ linters:
3636
- exhaustruct
3737
- exportloopref
3838
- fatcontext
39+
- filen
3940
- forbidigo
4041
- forcetypeassert
4142
- funlen
42-
- filen
4343
- gci
4444
- ginkgolinter
4545
- gocheckcompilerdirectives
@@ -153,10 +153,10 @@ linters:
153153
- exhaustruct
154154
- exportloopref
155155
- fatcontext
156+
- filen
156157
- forbidigo
157158
- forcetypeassert
158159
- funlen
159-
- filen
160160
- gci
161161
- ginkgolinter
162162
- gocheckcompilerdirectives
@@ -536,6 +536,17 @@ linters-settings:
536536
exclude:
537537
- '.+/cobra\.Command$'
538538

539+
filen:
540+
# Min number of lines in a file setting
541+
# Default: 5
542+
min-lines-num: 5
543+
# Max number of lines in a file setting
544+
# Default: 5
545+
max-lines-num: 500
546+
# Ignore comments when counting lines.
547+
# Default false
548+
ignore-comments: false
549+
539550
forbidigo:
540551
# Forbid the following identifiers (list of regexp).
541552
# Default: ["^(fmt\\.Print(|f|ln)|print|println)$"]
@@ -579,17 +590,6 @@ linters-settings:
579590
# Default false
580591
ignore-comments: true
581592

582-
filen:
583-
# Min number of lines in a file setting
584-
# Default: 5
585-
min-lines-num: 5
586-
# Max number of lines in a file setting
587-
# Default: 5
588-
max-lines-num: 500
589-
# Ignore comments when counting lines.
590-
# Default false
591-
ignore-comments: false
592-
593593
gci:
594594
# Section configuration to compare against.
595595
# Section names are case-insensitive and may contain parameters in ().

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/Antonboom/testifylint v1.5.0
1313
github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c
1414
github.com/Crocmagnon/fatcontext v0.5.2
15-
github.com/DanilXO/filen v0.0.2
15+
github.com/DanilXO/filen v0.1.0
1616
github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24
1717
github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0
1818
github.com/OpenPeeDeeP/depguard/v2 v2.2.0

go.sum

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/lint/lintersdb/builder_linter.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -284,6 +284,12 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
284284
WithURL("https://github.com/kyoh86/exportloopref").
285285
DeprecatedWarning("Since Go1.22 (loopvar) this linter is no longer relevant.", "v1.60.2", "copyloopvar"),
286286

287+
linter.NewConfig(filen.New(&cfg.LintersSettings.Filen)).
288+
WithSince("v1.62.0").
289+
WithPresets(linter.PresetComplexity).
290+
WithLoadForGoAnalysis().
291+
WithURL("https://github.com/DanilXO/filen"),
292+
287293
linter.NewConfig(forbidigo.New(&cfg.LintersSettings.Forbidigo)).
288294
WithSince("v1.34.0").
289295
WithPresets(linter.PresetStyle).
@@ -854,11 +860,5 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
854860
WithPresets(linter.PresetStyle).
855861
WithAutoFix().
856862
WithURL("https://github.com/golangci/golangci-lint/tree/master/pkg/golinters/nolintlint/internal"),
857-
858-
linter.NewConfig(filen.New(&cfg.LintersSettings.Filen)).
859-
WithSince("v1.62.0").
860-
WithPresets(linter.PresetComplexity).
861-
WithLoadForGoAnalysis().
862-
WithURL("https://github.com/DanilXO/filen"),
863863
}, nil
864864
}

0 commit comments

Comments
 (0)