.golangci.yml: Add intrange linter, fix issues #1459

Merged
fyrchik merged 3 commits from fyrchik/frostfs-node:golangci-intrange into master 2024-10-30 15:18:23 +00:00
Owner

Missing pieces from #1317

@@
var i, e expression
@@
-for i := 0; i <= e - 1; i++ {
+for i := range e {
    ...
}

@@
var i, e expression
@@
-for i := 0; i <= e; i++ {
+for i := range e + 1 {
    ...
}

@@
var i, e expression
@@
-for i := 0; i < e; i++ {
+for i := range e {
    ...
}

@@
var i, e expression
@@
-for i = 0; i <= e - 1; i++ {
+for i = range e {
    ...
}

@@
var i, e expression
@@
-for i = 0; i <= e; i++ {
+for i = range e + 1 {
    ...
}

@@
var i, e expression
@@
-for i = 0; i < e; i++ {
+for i = range e {
    ...
}



@@
var typ, i, e expression
@@
-for i := typ(0); i <= e - 1; i++ {
+for i := range e {
    ...
}

@@
var typ, i, e expression
@@
-for i := typ(0); i <= e; i++ {
+for i := range e + 1 {
    ...
}

@@
var typ, i, e expression
@@
-for i := typ(0); i < e; i++ {
+for i := range e {
    ...
}



@@
var typ, i, e expression
@@
-for i =  typ(0); i <= e - 1; i++ {
+for i = range e {
    ...
}

@@
var typ, i, e expression
@@
-for i =  typ(0); i <= e; i++ {
+for i = range e + 1 {
    ...
}

@@
var typ, i, e expression
@@
-for i =  typ(0); i < e; i++ {
+for i = range e {
    ...
}
Missing pieces from #1317 ``` @@ var i, e expression @@ -for i := 0; i <= e - 1; i++ { +for i := range e { ... } @@ var i, e expression @@ -for i := 0; i <= e; i++ { +for i := range e + 1 { ... } @@ var i, e expression @@ -for i := 0; i < e; i++ { +for i := range e { ... } @@ var i, e expression @@ -for i = 0; i <= e - 1; i++ { +for i = range e { ... } @@ var i, e expression @@ -for i = 0; i <= e; i++ { +for i = range e + 1 { ... } @@ var i, e expression @@ -for i = 0; i < e; i++ { +for i = range e { ... } @@ var typ, i, e expression @@ -for i := typ(0); i <= e - 1; i++ { +for i := range e { ... } @@ var typ, i, e expression @@ -for i := typ(0); i <= e; i++ { +for i := range e + 1 { ... } @@ var typ, i, e expression @@ -for i := typ(0); i < e; i++ { +for i := range e { ... } @@ var typ, i, e expression @@ -for i = typ(0); i <= e - 1; i++ { +for i = range e { ... } @@ var typ, i, e expression @@ -for i = typ(0); i <= e; i++ { +for i = range e + 1 { ... } @@ var typ, i, e expression @@ -for i = typ(0); i < e; i++ { +for i = range e { ... } ```
fyrchik added 1 commit 2024-10-30 11:43:42 +00:00
.golangci.yml: Add intrange linter, fix issues
Some checks failed
Tests and linters / Run gofumpt (pull_request) Successful in 1m28s
DCO action / DCO (pull_request) Failing after 1m40s
Vulncheck / Vulncheck (pull_request) Successful in 2m11s
Pre-commit hooks / Pre-commit (pull_request) Successful in 2m21s
Build / Build Components (pull_request) Successful in 2m29s
Tests and linters / gopls check (pull_request) Successful in 2m49s
Tests and linters / Staticcheck (pull_request) Successful in 3m2s
Tests and linters / Lint (pull_request) Successful in 3m42s
Tests and linters / Tests (pull_request) Successful in 4m21s
Tests and linters / Tests with -race (pull_request) Successful in 6m44s
a7d72503b5
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
fyrchik force-pushed golangci-intrange from a7d72503b5 to 5184e41d6c 2024-10-30 11:49:27 +00:00 Compare
fyrchik requested review from storage-core-committers 2024-10-30 12:07:29 +00:00
fyrchik requested review from storage-core-developers 2024-10-30 12:07:30 +00:00
aarifullin approved these changes 2024-10-30 12:09:06 +00:00
Dismissed
acid-ant approved these changes 2024-10-30 12:13:11 +00:00
Dismissed
dstepanov-yadro approved these changes 2024-10-30 12:13:11 +00:00
Dismissed
fyrchik force-pushed golangci-intrange from 5184e41d6c to 3d8499511e 2024-10-30 12:14:04 +00:00 Compare
fyrchik dismissed aarifullin's review 2024-10-30 12:14:04 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

fyrchik dismissed acid-ant's review 2024-10-30 12:14:04 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

fyrchik dismissed dstepanov-yadro's review 2024-10-30 12:14:04 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

achuprov approved these changes 2024-10-30 12:15:42 +00:00
Dismissed
fyrchik force-pushed golangci-intrange from 3d8499511e to ab1a9b177c 2024-10-30 12:34:35 +00:00 Compare
fyrchik dismissed achuprov's review 2024-10-30 12:34:35 +00:00
Reason:

New commits pushed, approval review dismissed automatically according to repository settings

fyrchik force-pushed golangci-intrange from ab1a9b177c to 60427905df 2024-10-30 12:36:08 +00:00 Compare
acid-ant approved these changes 2024-10-30 12:57:09 +00:00
a-savchuk approved these changes 2024-10-30 13:01:47 +00:00
fyrchik merged commit 48862e0e63 into master 2024-10-30 15:18:23 +00:00
fyrchik referenced this pull request from a commit 2024-10-30 15:18:23 +00:00
fyrchik deleted branch golangci-intrange 2024-10-30 15:18:25 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
6 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1459
No description provided.