noliteral: add noliteral configuration #6

Merged
dstepanov-yadro merged 2 commits from achuprov/linters:noliteral-configuration into master 2024-09-04 19:51:22 +00:00
Member

Added noliteral configuration for golangci >= 1.5.4.

Added noliteral configuration for golangci >= 1.5.4.
achuprov force-pushed noliteral-configuration from 9cddefcc6b to 1cbb08eea4 2023-07-31 14:45:45 +00:00 Compare
acid-ant requested changes 2023-07-31 14:51:19 +00:00
@ -16,3 +16,3 @@
}
var methodsToSearch = []string{"Debug", "Info", "Warn", "Error", "reportFlushError", "reportError"}
type Сonfiguration struct {
Member

Looks like you use here and below Cyrillic C instead of Latin.

Looks like you use here and below Cyrillic C instead of Latin.
Author
Member

fixed

fixed
acid-ant marked this conversation as resolved
achuprov requested review from storage-core-committers 2023-07-31 14:54:07 +00:00
achuprov requested review from storage-core-developers 2023-07-31 14:54:07 +00:00
dstepanov-yadro requested changes 2023-08-01 09:22:02 +00:00
@ -17,2 +17,3 @@
var methodsToSearch = []string{"Debug", "Info", "Warn", "Error", "reportFlushError", "reportError"}
type Сonfiguration struct {
MethodsToSearch []string `mapstructure:"target-methods"`

Is this tag required?

Is this tag required?
Author
Member

I change the variable name, but I left tag.

I change the variable name, but I left tag.
main.go Outdated
@ -15,0 +17,4 @@
// for version ci-lint >= '1.5.4'.
func New(conf any) ([]*analysis.Analyzer, error) {
var config noliteral.Сonfiguration

here too

here too
achuprov force-pushed noliteral-configuration from 1cbb08eea4 to e59c69bf24 2023-08-01 10:42:12 +00:00 Compare
dstepanov-yadro approved these changes 2023-08-01 10:55:48 +00:00
fyrchik approved these changes 2023-08-01 10:59:21 +00:00
@ -33,3 +33,3 @@
_, err = run(pass)
if Count != 6 {
if Count != 4 {
Owner

From 1 magic number to another, can we replace with a constant/some function? Is this len(Config.TargetMethods?

From 1 magic number to another, can we replace with a constant/some function? Is this `len(Config.TargetMethods`?
main.go Outdated
@ -15,0 +19,4 @@
func New(conf any) ([]*analysis.Analyzer, error) {
var config noliteral.Configuration
if confMap, ok := conf.(map[string]interface{}); ok {
Owner

any in the arguments, but interface{} here, what about any everywhere?

`any` in the arguments, but `interface{}` here, what about `any` everywhere?
Author
Member

fixed

fixed
achuprov force-pushed noliteral-configuration from e59c69bf24 to a1a45f5368 2023-08-01 11:40:09 +00:00 Compare
dstepanov-yadro requested review from acid-ant 2023-08-01 14:59:53 +00:00
acid-ant approved these changes 2023-08-02 05:34:58 +00:00
dstepanov-yadro merged commit a1a45f5368 into master 2023-08-02 07:32:18 +00:00
dstepanov-yadro referenced this pull request from a commit 2023-08-02 07:32:19 +00:00
Sign in to join this conversation.
No description provided.