-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
dev: displays revive rules inside debug logs #5325
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
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 tasks
New render: $ GL_DEBUG=revive go run ./cmd/golangci-lint/ run --enable-only=revive
DEBU [revive] All available rules (81): add-constant, argument-limit, atomic, banned-characters, bare-return, blank-imports, bool-literal-in-expr, call-to-gc, cognitive-complexity, comment-spacings, comments-density, confusing-naming, confusing-results, constant-logical-expr, context-as-argument, context-keys-type, cyclomatic, datarace, deep-exit, defer, dot-imports, duplicated-imports, early-return, empty-block, empty-lines, enforce-map-style, enforce-repeated-arg-type-style, enforce-slice-style, error-naming, error-return, error-strings, errorf, exported, file-header, file-length-limit, filename-format, flag-parameter, function-length, function-result-limit, get-return, identical-branches, if-return, import-alias-naming, import-shadowing, imports-blocklist, increment-decrement, indent-error-flow, line-length-limit, max-control-nesting, max-public-structs, modifies-parameter, modifies-value-receiver, nested-structs, optimize-operands-order, package-comments, range, range-val-address, range-val-in-closure, receiver-naming, redefines-builtin-id, redundant-import-alias, string-format, string-of-int, struct-tag, superfluous-else, time-equal, time-naming, unchecked-type-assertion, unconditional-recursion, unexported-naming, unexported-return, unhandled-error, unnecessary-stmt, unreachable-code, unused-parameter, unused-receiver, use-any, useless-break, var-declaration, var-naming, waitgroup-by-value.
DEBU [revive] Default rules (81): add-constant, argument-limit, atomic, banned-characters, bare-return, blank-imports, bool-literal-in-expr, call-to-gc, cognitive-complexity, comment-spacings, comments-density, confusing-naming, confusing-results, constant-logical-expr, context-as-argument, context-keys-type, cyclomatic, datarace, deep-exit, defer, dot-imports, duplicated-imports, early-return, empty-block, empty-lines, enforce-map-style, enforce-repeated-arg-type-style, enforce-slice-style, error-naming, error-return, error-strings, errorf, exported, file-header, file-length-limit, filename-format, flag-parameter, function-length, function-result-limit, get-return, identical-branches, if-return, import-alias-naming, import-shadowing, imports-blocklist, increment-decrement, indent-error-flow, line-length-limit, max-control-nesting, max-public-structs, modifies-parameter, modifies-value-receiver, nested-structs, optimize-operands-order, package-comments, range, range-val-address, range-val-in-closure, receiver-naming, redefines-builtin-id, redundant-import-alias, string-format, string-of-int, struct-tag, superfluous-else, time-equal, time-naming, unchecked-type-assertion, unconditional-recursion, unexported-naming, unexported-return, unhandled-error, unnecessary-stmt, unreachable-code, unused-parameter, unused-receiver, use-any, useless-break, var-declaration, var-naming, waitgroup-by-value.
DEBU [revive] Enabled by config rules (3): indent-error-flow, unused-parameter, unused-receiver.
DEBU [revive] revive configuration: &lint.Config{IgnoreGeneratedHeader:false, Confidence:0.8, Severity:"warning", EnableAllRules:false, Rules:map[string]lint.RuleConfig{"indent-error-flow":lint.RuleConfig{Arguments:[]interface {}(nil), Severity:"warning", Disabled:false, Exclude:[]string(nil), excludeFilters:[]*lint.FileFilter(nil)}, "unexported-return":lint.RuleConfig{Arguments:[]interface {}(nil), Severity:"warning", Disabled:true, Exclude:[]string(nil), excludeFilters:[]*lint.FileFilter(nil)}, "unused-parameter":lint.RuleConfig{Arguments:[]interface {}(nil), Severity:"warning", Disabled:false, Exclude:[]string(nil), excludeFilters:[]*lint.FileFilter(nil)}, "unused-receiver":lint.RuleConfig{Arguments:[]interface {}(nil), Severity:"warning", Disabled:false, Exclude:[]string(nil), excludeFilters:[]*lint.FileFilter(nil)}}, ErrorCode:0, WarningCode:0, Directives:map[string]lint.DirectiveConfig(nil), Exclude:[]string(nil), GoVersion:(*version.Version)(nil)} Some notes:
Also, the last log, with the full configuration, is not kept for "compatibility" but because this is an important log as revive configuration parsing is not trivial. |
alexandear
reviewed
Jan 15, 2025
alexandear
reviewed
Jan 15, 2025
ccoVeille
commented
Jan 15, 2025
alexandear
approved these changes
Jan 15, 2025
ldez
approved these changes
Jan 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
linter: update
Update the linter implementation inside golangci-lint
topic: cosmetic
changes contain cosmetic improvements
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here is the result
The last line comes from the existing debug message available for revive linter.
It was kept for compatibility purpose.