-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(cmd/gno): lint all files in folder before panicking (#2202)
This Pull request intents to follow up on #2011. As said on that Pull request, currently we show all lint errors on the first analyzed file. If in a folder we have `a.gno` & `b.gno` both with lint errors. `gno lint | run | test` will only find the errors related to one of those files. **This PR aims to show all the lint errors present on the current folder**. Changes: for lint & test cmd: - we modified ParseMemPackage function on gnovm/pkg/gnoland/nodes.go. Before this function returned as soon as an error was found while Parsing the gno file. So we introduced an error slice to keep track of all Parse errors. After parsing all the files we panic with the list of errors only if this list is not empty. - we did the same on parseMemPackageTests function - create a function printRuntimeError that handles the print of the errors inside `catchRuntimeError` function. We did this change in order to be able to recursively call the funtion and handle the case of an []error type composed of scanner.ErrorList errors. ### Results * running on gnovm/tests/integ/several-files-multiple/errors LINT (before): ```sh several-files-multiple-errors % gno lint . file2.gno:3: expected 'IDENT', found '{' (code=2). file2.gno:5: expected type, found '}' (code=2). ``` LINT (after): ```sh gno lint . file2.gno:3: expected 'IDENT', found '{' (code=2). file2.gno:5: expected type, found '}' (code=2). main.gno:5: expected ';', found example (code=2). main.gno:6: expected '}', found 'EOF' (code=2). exit status 1 ``` <!-- please provide a detailed description of the changes made in this pull request. --> <details> <summary>Contributors' checklist...</summary> - [ ] Added new tests, or not needed, or not feasible - [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [ ] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details>
- Loading branch information
1 parent
6fafe0e
commit 464c7f1
Showing
8 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package main | ||
|
||
type{ | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module gno.land/tests/severalerrors |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package main | ||
|
||
func main() { | ||
for { | ||
_ example | ||
} |
464c7f1
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.
Possible performance regression was detected for benchmark 'Go Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.20
.BenchmarkBinary/EmptyStruct:encode
479.8
ns/op 96 B/op 2 allocs/op288.3
ns/op 96 B/op 2 allocs/op1.66
BenchmarkBinary/EmptyStruct:encode - ns/op
479.8
ns/op288.3
ns/op1.66
BenchmarkBinary/EmptyStruct:decode
311.4
ns/op 0 B/op 0 allocs/op140.2
ns/op 0 B/op 0 allocs/op2.22
BenchmarkBinary/EmptyStruct:decode - ns/op
311.4
ns/op140.2
ns/op2.22
BenchmarkBinary/ShortArraysStruct:encode
787.7
ns/op 192 B/op 4 allocs/op614.7
ns/op 192 B/op 4 allocs/op1.28
BenchmarkBinary/ShortArraysStruct:encode - ns/op
787.7
ns/op614.7
ns/op1.28
BenchmarkBinary/ShortArraysStruct:decode
364.5
ns/op 0 B/op 0 allocs/op231.7
ns/op 0 B/op 0 allocs/op1.57
BenchmarkBinary/ShortArraysStruct:decode - ns/op
364.5
ns/op231.7
ns/op1.57
BenchmarkBinary/EmbeddedSt1:encode
6599
ns/op 2037 B/op 65 allocs/op4635
ns/op 2037 B/op 65 allocs/op1.42
BenchmarkBinary/EmbeddedSt1:encode - ns/op
6599
ns/op4635
ns/op1.42
BenchmarkRemoved
38.8
ns/op 0 B/op 0 allocs/op29.18
ns/op 0 B/op 0 allocs/op1.33
BenchmarkRemoved - ns/op
38.8
ns/op29.18
ns/op1.33
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
63787927
ns/op 5130 B/op 9 allocs/op31934980
ns/op 5125 B/op 9 allocs/op2.00
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
63787927
ns/op31934980
ns/op2.00
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
127510712
ns/op 5139 B/op 9 allocs/op31934980
ns/op 5125 B/op 9 allocs/op3.99
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
127510712
ns/op31934980
ns/op3.99
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
254996749
ns/op 5158 B/op 9 allocs/op31934980
ns/op 5125 B/op 9 allocs/op7.98
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
254996749
ns/op31934980
ns/op7.98
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
509961163
ns/op 5196 B/op 10 allocs/op31934980
ns/op 5125 B/op 9 allocs/op15.97
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
509961163
ns/op31934980
ns/op15.97
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
1019782468
ns/op 5528 B/op 13 allocs/op31934980
ns/op 5125 B/op 9 allocs/op31.93
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
1019782468
ns/op31934980
ns/op31.93
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - allocs/op
13
allocs/op9
allocs/op1.44
BenchmarkBcryptGenerateFromPassword/benchmark-security-param
2043637854
ns/op 5736 B/op 15 allocs/op31934980
ns/op 5125 B/op 9 allocs/op63.99
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - ns/op
2043637854
ns/op31934980
ns/op63.99
BenchmarkBcryptGenerateFromPassword/benchmark-security-param - allocs/op
15
allocs/op9
allocs/op1.67
BenchmarkSigning
84318
ns/op 1856 B/op 36 allocs/op25734
ns/op 64 B/op 1 allocs/op3.28
BenchmarkSigning - ns/op
84318
ns/op25734
ns/op3.28
BenchmarkSigning - B/op
1856
B/op64
B/op29
BenchmarkSigning - allocs/op
36
allocs/op1
allocs/op36
BenchmarkSigning
84233
ns/op 1856 B/op 36 allocs/op25734
ns/op 64 B/op 1 allocs/op3.27
BenchmarkSigning - ns/op
84233
ns/op25734
ns/op3.27
BenchmarkSigning - B/op
1856
B/op64
B/op29
BenchmarkSigning - allocs/op
36
allocs/op1
allocs/op36
BenchmarkVerification
164562
ns/op 864 B/op 19 allocs/op61021
ns/op 0 B/op 0 allocs/op2.70
BenchmarkVerification - ns/op
164562
ns/op61021
ns/op2.70
BenchmarkVerification - B/op
864
B/op0
B/op+∞
BenchmarkVerification - allocs/op
19
allocs/op0
allocs/op+∞
BenchmarkVerification
166612
ns/op 864 B/op 19 allocs/op61021
ns/op 0 B/op 0 allocs/op2.73
BenchmarkVerification - ns/op
166612
ns/op61021
ns/op2.73
BenchmarkVerification - B/op
864
B/op0
B/op+∞
BenchmarkVerification - allocs/op
19
allocs/op0
allocs/op+∞
BenchmarkImmutableAvlTreeMemDB
4061861
ns/op 1100202 B/op 22398 allocs/op3325964
ns/op 857704 B/op 17427 allocs/op1.22
BenchmarkImmutableAvlTreeMemDB - ns/op
4061861
ns/op3325964
ns/op1.22
BenchmarkImmutableAvlTreeMemDB - B/op
1100202
B/op857704
B/op1.28
BenchmarkImmutableAvlTreeMemDB - allocs/op
22398
allocs/op17427
allocs/op1.29
BenchmarkRandomBytes/random
68.89
ns/op 16 B/op 1 allocs/op32.66
ns/op 4 B/op 1 allocs/op2.11
BenchmarkRandomBytes/random - ns/op
68.89
ns/op32.66
ns/op2.11
BenchmarkRandomBytes/random - B/op
16
B/op4
B/op4
BenchmarkRandomBytes/random
104.6
ns/op 32 B/op 1 allocs/op32.66
ns/op 4 B/op 1 allocs/op3.20
BenchmarkRandomBytes/random - ns/op
104.6
ns/op32.66
ns/op3.20
BenchmarkRandomBytes/random - B/op
32
B/op4
B/op8
BenchmarkRandomBytes/random
265.6
ns/op 112 B/op 1 allocs/op32.66
ns/op 4 B/op 1 allocs/op8.13
BenchmarkRandomBytes/random - ns/op
265.6
ns/op32.66
ns/op8.13
BenchmarkRandomBytes/random - B/op
112
B/op4
B/op28
BenchmarkRandomBytes/random
2333
ns/op 1024 B/op 1 allocs/op32.66
ns/op 4 B/op 1 allocs/op71.43
BenchmarkRandomBytes/random - ns/op
2333
ns/op32.66
ns/op71.43
BenchmarkRandomBytes/random - B/op
1024
B/op4
B/op256
BenchmarkSmall/boltdb-1000-100-16-40/update
1464955
ns/op 46705 B/op 396 allocs/op997741
ns/op 37826 B/op 373 allocs/op1.47
BenchmarkSmall/boltdb-1000-100-16-40/update - ns/op
1464955
ns/op997741
ns/op1.47
BenchmarkSmall/boltdb-1000-100-16-40/update - B/op
46705
B/op37826
B/op1.23
BenchmarkSmall/boltdb-1000-100-16-40/block - B/op
5581621
B/op4604422
B/op1.21
BenchmarkSmall/memdb-1000-100-16-40/block
15653451
ns/op 9085344 B/op 165390 allocs/op11971467
ns/op 6577289 B/op 116694 allocs/op1.31
BenchmarkSmall/memdb-1000-100-16-40/block - ns/op
15653451
ns/op11971467
ns/op1.31
BenchmarkSmall/memdb-1000-100-16-40/block - B/op
9085344
B/op6577289
B/op1.38
BenchmarkSmall/memdb-1000-100-16-40/block - allocs/op
165390
allocs/op116694
allocs/op1.42
BenchmarkMedium/boltdb-100000-100-16-40/update
6952487
ns/op 131336 B/op 1022 allocs/op5177408
ns/op 99356 B/op 841 allocs/op1.34
BenchmarkMedium/boltdb-100000-100-16-40/update - ns/op
6952487
ns/op5177408
ns/op1.34
BenchmarkMedium/boltdb-100000-100-16-40/update - B/op
131336
B/op99356
B/op1.32
BenchmarkMedium/boltdb-100000-100-16-40/update - allocs/op
1022
allocs/op841
allocs/op1.22
BenchmarkMedium/memdb-100000-100-16-40/update - B/op
357273
B/op258282
B/op1.38
BenchmarkMedium/memdb-100000-100-16-40/update - allocs/op
7077
allocs/op4982
allocs/op1.42
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/update - B/op
48961
B/op38908
B/op1.26
BenchmarkLevelDBBatchSizes/goleveldb-100000-400-16-40/update - allocs/op
587
allocs/op449
allocs/op1.31
BenchmarkLevelDBBatchSizes/goleveldb-100000-2000-16-40/block - B/op
96204320
B/op79473414
B/op1.21
BenchmarkHash/ripemd160
2830
ns/op 25 B/op 1 allocs/op709.3
ns/op 25 B/op 1 allocs/op3.99
BenchmarkHash/ripemd160 - ns/op
2830
ns/op709.3
ns/op3.99
BenchmarkHash/sha2-256
521.5
ns/op 33 B/op 1 allocs/op168.6
ns/op 33 B/op 1 allocs/op3.09
BenchmarkHash/sha2-256 - ns/op
521.5
ns/op168.6
ns/op3.09
BenchmarkHash/sha3-256
1836
ns/op 33 B/op 1 allocs/op716
ns/op 33 B/op 1 allocs/op2.56
BenchmarkHash/sha3-256 - ns/op
1836
ns/op716
ns/op2.56
BenchmarkWriteSecretConnection
6120
ns/op 0 B/op 0 allocs/op4027
ns/op 0 B/op 0 allocs/op1.52
BenchmarkWriteSecretConnection - ns/op
6120
ns/op4027
ns/op1.52
BenchmarkReadSecretConnection
3436
ns/op 0 B/op 0 allocs/op2358
ns/op 0 B/op 0 allocs/op1.46
BenchmarkReadSecretConnection - ns/op
3436
ns/op2358
ns/op1.46
BenchmarkCacheStoreIterator100000 - allocs/op
25254
allocs/op20208
allocs/op1.25
This comment was automatically generated by workflow using github-action-benchmark.
CC: @ajnavarro @thehowl @zivkovicmilos