Skip to content

feat: updating funcorder to v0.3.0, support for alphabetical. #5745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
148 changes: 96 additions & 52 deletions .golangci.next.reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,9 @@ linters:
# Checks if the exported methods of a structure are placed before the non-exported ones.
# Default: true
struct-method: false
# Checks if the constructors and/or structure methods are sorted alphabetically.
# Default: false
alphabetical: true

funlen:
# Checks the number of lines in a function.
Expand Down Expand Up @@ -642,7 +645,7 @@ linters:
# Exclude strings matching the given regular expression.
# Default: ""
ignore-string-values:
- 'foo.+'
- "foo.+"
# Detects constants with identical values.
# Default: false
find-duplicates: true
Expand Down Expand Up @@ -1167,7 +1170,7 @@ linters:
#
# The option is passed to the ruleguard 'debug-group' argument.
# Default: ""
debug: 'emptyDecl'
debug: "emptyDecl"
# Determines the behavior when an error occurs while parsing ruleguard files.
# If flag is not set, log error and skip rule files that contain an error.
# If flag is set, the value must be a comma-separated list of error conditions.
Expand All @@ -1182,7 +1185,7 @@ linters:
# The placeholder '${config-path}' is substituted with a path relative to the configuration file.
# Glob patterns such as 'rules-*.go' may be specified.
# Default: ""
rules: '${base-path}/ruleguard/rules-*.go,${base-path}/myrule1.go'
rules: "${base-path}/ruleguard/rules-*.go,${base-path}/myrule1.go"
# Comma-separated list of enabled groups or skip empty to enable everything.
# Tags can be defined with # character prefix.
# Default: "<all>"
Expand Down Expand Up @@ -1533,11 +1536,11 @@ linters:
#
# Default: []
escape-hatches:
- 'github.com/nicksnyder/go-i18n/v2/i18n.Message'
- 'example.com/your/project/i18n/markers.Raw'
- 'example.com/your/project/i18n/markers.OK'
- 'example.com/your/project/i18n/markers.TODO'
- 'command-line-arguments.Simple'
- "github.com/nicksnyder/go-i18n/v2/i18n.Message"
- "example.com/your/project/i18n/markers.Raw"
- "example.com/your/project/i18n/markers.OK"
- "example.com/your/project/i18n/markers.TODO"
- "command-line-arguments.Simple"
# List of Unicode scripts to watch for any usage in string literals.
# https://pkg.go.dev/unicode#pkg-variables
#
Expand Down Expand Up @@ -1886,9 +1889,9 @@ linters:
# For example: https://github.com/timonwong/loggercheck/blob/7395ab86595781e33f7afba27ad7b55e6956ebcd/testdata/custom-rules.txt
# Default: empty
rules:
- k8s.io/klog/v2.InfoS # package level exported functions
- (github.com/go-logr/logr.Logger).Error # "Methods"
- (*go.uber.org/zap.SugaredLogger).With # Also "Methods", but with a pointer receiver
- k8s.io/klog/v2.InfoS # package level exported functions
- (github.com/go-logr/logr.Logger).Error # "Methods"
- (*go.uber.org/zap.SugaredLogger).With # Also "Methods", but with a pointer receiver

maintidx:
# Show functions with maintainability index lower than N.
Expand Down Expand Up @@ -1941,9 +1944,9 @@ linters:
# Values always ignored: "1", "1.0", "0" and "0.0".
# Default: []
ignored-numbers:
- '0666'
- '0755'
- '42'
- "0666"
- "0755"
- "42"
# List of file patterns to exclude from analysis.
# Values always ignored: `.+_test.go`.
# Default: []
Expand Down Expand Up @@ -2011,7 +2014,7 @@ linters:
allow-unused: true
# Exclude following linters from requiring an explanation.
# Default: []
allow-no-explanation: [ ]
allow-no-explanation: []
# Enable to require an explanation of nonzero length after each nolint directive.
# Default: false
require-explanation: true
Expand Down Expand Up @@ -2199,7 +2202,7 @@ linters:
severity: warning
disabled: false
exclude: [""]
arguments: [ 4 ]
arguments: [4]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#atomic
- name: atomic
severity: warning
Expand All @@ -2210,7 +2213,7 @@ linters:
severity: warning
disabled: false
exclude: [""]
arguments: [ "Ω","Σ","σ", "7" ]
arguments: ["Ω", "Σ", "σ", "7"]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#bare-return
- name: bare-return
severity: warning
Expand All @@ -2236,7 +2239,7 @@ linters:
severity: warning
disabled: false
exclude: [""]
arguments: [ 7 ]
arguments: [7]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#comment-spacings
- name: comment-spacings
severity: warning
Expand All @@ -2250,7 +2253,7 @@ linters:
severity: warning
disabled: false
exclude: [""]
arguments: [ 15 ]
arguments: [15]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#confusing-naming
- name: confusing-naming
severity: warning
Expand Down Expand Up @@ -2283,7 +2286,7 @@ linters:
severity: warning
disabled: false
exclude: [""]
arguments: [ 3 ]
arguments: [3]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#datarace
- name: datarace
severity: warning
Expand Down Expand Up @@ -2312,7 +2315,8 @@ linters:
disabled: false
exclude: [""]
arguments:
- allowed-packages: ["github.com/onsi/ginkgo/v2", "github.com/onsi/gomega"]
- allowed-packages:
["github.com/onsi/ginkgo/v2", "github.com/onsi/gomega"]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#duplicated-imports
- name: duplicated-imports
severity: warning
Expand Down Expand Up @@ -2430,13 +2434,13 @@ linters:
severity: warning
disabled: false
exclude: [""]
arguments: [ 10, 0 ]
arguments: [10, 0]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#function-result-limit
- name: function-result-limit
severity: warning
disabled: false
exclude: [""]
arguments: [ 3 ]
arguments: [3]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#get-return
- name: get-return
severity: warning
Expand Down Expand Up @@ -2492,19 +2496,19 @@ linters:
severity: warning
disabled: false
exclude: [""]
arguments: [ 80 ]
arguments: [80]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#max-control-nesting
- name: max-control-nesting
severity: warning
disabled: false
exclude: [""]
arguments: [ 3 ]
arguments: [3]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#max-public-structs
- name: max-public-structs
severity: warning
disabled: false
exclude: [""]
arguments: [ 3 ]
arguments: [3]
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#modifies-parameter
- name: modifies-parameter
severity: warning
Expand Down Expand Up @@ -2578,10 +2582,10 @@ linters:
disabled: false
exclude: [""]
arguments:
- - 'core.WriteError[1].Message'
- '/^([^A-Z]|$)/'
- - "core.WriteError[1].Message"
- "/^([^A-Z]|$)/"
- must not start with a capital letter
- - 'fmt.Errorf[0]'
- - "fmt.Errorf[0]"
- '/(^|[^\.!?])$/'
- must not end in punctuation
- - panic
Expand Down Expand Up @@ -2697,8 +2701,8 @@ linters:
disabled: false
exclude: [""]
arguments:
- [ "ID" ] # AllowList
- [ "VM" ] # DenyList
- ["ID"] # AllowList
- ["VM"] # DenyList
- - upper-case-const: true # Extra parameter (upper-case-const|skip-package-name-checks)
# https://github.com/mgechev/revive/blob/HEAD/RULES_DESCRIPTIONS.md#waitgroup-by-value
- name: waitgroup-by-value
Expand Down Expand Up @@ -2805,10 +2809,54 @@ linters:
- fmt
# https://staticcheck.dev/docs/configuration/options/#initialisms
# Default: ["ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS"]
initialisms: [ "ACL", "API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP", "HTTPS", "ID", "IP", "JSON", "QPS", "RAM", "RPC", "SLA", "SMTP", "SQL", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "GID", "UID", "UUID", "URI", "URL", "UTF8", "VM", "XML", "XMPP", "XSRF", "XSS", "SIP", "RTP", "AMQP", "DB", "TS" ]
initialisms:
[
"ACL",
"API",
"ASCII",
"CPU",
"CSS",
"DNS",
"EOF",
"GUID",
"HTML",
"HTTP",
"HTTPS",
"ID",
"IP",
"JSON",
"QPS",
"RAM",
"RPC",
"SLA",
"SMTP",
"SQL",
"SSH",
"TCP",
"TLS",
"TTL",
"UDP",
"UI",
"GID",
"UID",
"UUID",
"URI",
"URL",
"UTF8",
"VM",
"XML",
"XMPP",
"XSRF",
"XSS",
"SIP",
"RTP",
"AMQP",
"DB",
"TS",
]
# https://staticcheck.dev/docs/configuration/options/#http_status_code_whitelist
# Default: ["200", "400", "404", "500"]
http-status-code-whitelist: [ "200", "400", "404", "500" ]
http-status-code-whitelist: ["200", "400", "404", "500"]
# SAxxxx checks in https://staticcheck.dev/docs/configuration/options/#checks
# Example (to disable some checks): [ "all", "-SA1000", "-SA1001"]
# Default: ["all", "-ST1000", "-ST1003", "-ST1016", "-ST1020", "-ST1021", "-ST1022"]
Expand Down Expand Up @@ -3404,8 +3452,7 @@ linters:
# Overrides the default/root configuration.
# Default: []
overrides:
-
# The package path (uses `/` only as a separator).
- # The package path (uses `/` only as a separator).
# Required
pkg: foo/bar
# Default: empty or the same as the default/root configuration.
Expand Down Expand Up @@ -3835,12 +3882,12 @@ linters:

# A list of call idents that everything can be cuddled with.
# Defaults: [ "Lock", "RLock" ]
allow-cuddle-with-calls: [ "Foo", "Bar" ]
allow-cuddle-with-calls: ["Foo", "Bar"]

# AllowCuddleWithRHS is a list of right hand side variables that is allowed
# to be cuddled with anything.
# Defaults: [ "Unlock", "RUnlock" ]
allow-cuddle-with-rhs: [ "Foo", "Bar" ]
allow-cuddle-with-rhs: ["Foo", "Bar"]

# Allow cuddling with any block as long as the variable is used somewhere in
# the block.
Expand All @@ -3857,7 +3904,7 @@ linters:
# When force-err-cuddling is enabled this is a list of names
# used for error variables to check for in the conditional.
# Default: [ "err" ]
error-variable-names: [ "foo" ]
error-variable-names: ["foo"]

# Causes an error if a short declaration (:=) cuddles with anything other than
# another short declaration.
Expand Down Expand Up @@ -3979,13 +4026,13 @@ formatters:
# If `custom-order` is `true`, it follows the order of `sections` option.
# Default: ["standard", "default"]
sections:
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- standard # Standard section: captures all standard packages.
- default # Default section: contains all imports that could not be matched to another section type.
- prefix(github.com/org/project) # Custom section: groups all imports with the specified Prefix.
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
- alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled.
- localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.
- blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled.
- dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled.
- alias # Alias section: contains all alias imports. This section is not present unless explicitly enabled.
- localmodule # Local module section: contains all local packages. This section is not present unless explicitly enabled.

# Checks that no inline comments are present.
# Default: false
Expand All @@ -4012,10 +4059,10 @@ formatters:
# https://pkg.go.dev/cmd/gofmt
# Default: []
rewrite-rules:
- pattern: 'interface{}'
replacement: 'any'
- pattern: 'a[b:len(a)]'
replacement: 'a[b:]'
- pattern: "interface{}"
replacement: "any"
- pattern: "a[b:len(a)]"
replacement: "a[b:]"

gofumpt:
# Module path which contains the source code being formatted.
Expand Down Expand Up @@ -4114,7 +4161,6 @@ issues:
# Default: false
fix: true


# Output configuration options.
output:
# The formats used to render issues.
Expand Down Expand Up @@ -4217,7 +4263,6 @@ output:
# Default: true
show-stats: false


# Options for analysis running.
run:
# Timeout for total work, e.g. 30s, 5m, 5m30s.
Expand Down Expand Up @@ -4273,14 +4318,13 @@ run:

# Define the Go version limit.
# Default: use Go version from the go.mod file, fallback on the env var `GOVERSION`, fallback on 1.22.
go: '1.23'
go: "1.23"

# Number of operating system threads (`GOMAXPROCS`) that can execute golangci-lint simultaneously.
# Default: 0 (automatically set to match Linux container CPU quota and
# fall back to the number of logical CPUs in the machine)
concurrency: 4


severity:
# Set the default severity for issues.
#
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ require (
github.com/ldez/usetesting v0.4.3
github.com/leonklingele/grouper v1.1.2
github.com/macabu/inamedparam v0.2.0
github.com/manuelarte/funcorder v0.2.1
github.com/manuelarte/funcorder v0.3.0
github.com/maratori/testableexamples v1.0.0
github.com/maratori/testpackage v1.1.1
github.com/matoous/godox v1.1.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading