Skip to content

Commit e4bb2cb

Browse files
committed
Refactoring
1 parent 95ba1a4 commit e4bb2cb

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
@@ -152,10 +152,10 @@ linters:
152152
- exhaustruct
153153
- exportloopref
154154
- fatcontext
155+
- filen
155156
- forbidigo
156157
- forcetypeassert
157158
- funlen
158-
- filen
159159
- gci
160160
- ginkgolinter
161161
- gocheckcompilerdirectives
@@ -534,6 +534,17 @@ linters-settings:
534534
exclude:
535535
- '.+/cobra\.Command$'
536536

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

580-
filen:
581-
# Min number of lines in a file setting
582-
# Default: 5
583-
min-lines-num: 5
584-
# Max number of lines in a file setting
585-
# Default: 5
586-
max-lines-num: 500
587-
# Ignore comments when counting lines.
588-
# Default false
589-
ignore-comments: false
590-
591591
gci:
592592
# Section configuration to compare against.
593593
# 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
@@ -283,6 +283,12 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
283283
WithURL("https://github.com/kyoh86/exportloopref").
284284
DeprecatedWarning("Since Go1.22 (loopvar) this linter is no longer relevant.", "v1.60.2", "copyloopvar"),
285285

286+
linter.NewConfig(filen.New(&cfg.LintersSettings.Filen)).
287+
WithSince("v1.62.0").
288+
WithPresets(linter.PresetComplexity).
289+
WithLoadForGoAnalysis().
290+
WithURL("https://github.com/DanilXO/filen"),
291+
286292
linter.NewConfig(forbidigo.New(&cfg.LintersSettings.Forbidigo)).
287293
WithSince("v1.34.0").
288294
WithPresets(linter.PresetStyle).
@@ -847,11 +853,5 @@ func (LinterBuilder) Build(cfg *config.Config) ([]*linter.Config, error) {
847853
WithPresets(linter.PresetStyle).
848854
WithAutoFix().
849855
WithURL("https://github.com/golangci/golangci-lint/tree/master/pkg/golinters/nolintlint/internal"),
850-
851-
linter.NewConfig(filen.New(&cfg.LintersSettings.Filen)).
852-
WithSince("v1.62.0").
853-
WithPresets(linter.PresetComplexity).
854-
WithLoadForGoAnalysis().
855-
WithURL("https://github.com/DanilXO/filen"),
856856
}, nil
857857
}

0 commit comments

Comments
 (0)