Skip to content
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

fix: lint issues #1487

Merged
merged 5 commits into from
Mar 22, 2023
Merged

fix: lint issues #1487

merged 5 commits into from
Mar 22, 2023

Conversation

GAtom22
Copy link
Contributor

@GAtom22 GAtom22 commented Mar 21, 2023

Description

When updated the gh actions workflows to use go 1.20 on this PR, the golangci-lint was upgraded to v1.52.0. This upgrade brought up many lint issues that weren't considered before. This PR addresses those lint issues


Closes #XXX

@github-actions github-actions bot added the CLI label Mar 21, 2023
@GAtom22 GAtom22 marked this pull request as ready for review March 21, 2023 17:32
@GAtom22 GAtom22 requested review from hanchon and a team as code owners March 21, 2023 17:32
@GAtom22 GAtom22 requested review from 0a1c, facs95, Vvaradinov, a team and MalteHerrmann and removed request for a team March 21, 2023 17:32
@GAtom22 GAtom22 mentioned this pull request Mar 21, 2023
@GAtom22 GAtom22 enabled auto-merge (squash) March 21, 2023 20:09
@codecov
Copy link

codecov bot commented Mar 21, 2023

Codecov Report

Merging #1487 (8197f26) into main (6ad3076) will increase coverage by 0.05%.
The diff coverage is 62.71%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1487      +/-   ##
==========================================
+ Coverage   73.08%   73.13%   +0.05%     
==========================================
  Files         268      268              
  Lines       18446    18415      -31     
==========================================
- Hits        13481    13468      -13     
+ Misses       4365     4350      -15     
+ Partials      600      597       -3     
Impacted Files Coverage Δ
ethereum/eip712/eip712_legacy.go 60.32% <0.00%> (ø)
rpc/backend/node_info.go 46.51% <ø> (ø)
tests/e2e/upgrade/manager.go 0.00% <0.00%> (ø)
x/claims/types/msg.go 0.00% <0.00%> (ø)
x/erc20/keeper/evm_hooks.go 88.88% <ø> (ø)
x/evm/statedb/statedb.go 98.43% <0.00%> (ø)
x/evm/types/tracer.go 7.14% <ø> (ø)
x/incentives/types/msg.go 0.00% <0.00%> (ø)
x/inflation/keeper/inflation.go 84.53% <ø> (ø)
x/recovery/types/msg.go 0.00% <0.00%> (ø)
... and 17 more

Copy link
Contributor

@MalteHerrmann MalteHerrmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff @GAtom22! I left a bunch of comments, but these are all concerned with 2 main things:

  1. I wouldn't use nolint:all except where it's necessary, and always indicate why the linter is escaped using the comments
  2. Personally I would prefer if we follow a clear standard in the repo. I see that it makes sense for mocked functions to still have the unused parameters in the function signature to describe the expected interface. How about we do the following:
  • In case of mocking, leave the unused parameters as is and comment with //nolint:revive // allow unused parameters to indicate expected signature
  • In case we're not mocking, replace unused parameters with _
  • All code, where we are sure that it can be removed without problems (e.g. testsuite setup), remove unused parameters from signature

app/ante/evm/utils_test.go Outdated Show resolved Hide resolved
app/ante/evm/utils_test.go Outdated Show resolved Hide resolved
client/keys/add.go Outdated Show resolved Hide resolved
cmd/evmosd/init.go Outdated Show resolved Hide resolved
ibc/module_test.go Outdated Show resolved Hide resolved
x/ibc/transfer/keeper/keeper_test.go Outdated Show resolved Hide resolved
x/ibc/transfer/keeper/keeper_test.go Outdated Show resolved Hide resolved
x/ibc/transfer/keeper/keeper_test.go Outdated Show resolved Hide resolved
x/ibc/transfer/keeper/keeper_test.go Outdated Show resolved Hide resolved
x/inflation/keeper/utils_test.go Outdated Show resolved Hide resolved
MalteHerrmann

This comment was marked as duplicate.

GAtom22 and others added 4 commits March 22, 2023 11:35
recover, _ := cmd.Flags().GetBool(genutilcli.FlagRecover)
if recover {

recoverKey, _ := cmd.Flags().GetBool(genutilcli.FlagRecover)

Check warning

Code scanning / gosec

Returned error is not propagated up the stack.

Returned error is not propagated up the stack.
@@ -196,8 +196,8 @@
// Get bip39 mnemonic
var mnemonic, bip39Passphrase string

recover, _ := cmd.Flags().GetBool(flagRecover)
if recover {
recoverKey, _ := cmd.Flags().GetBool(flagRecover)

Check warning

Code scanning / gosec

Returned error is not propagated up the stack.

Returned error is not propagated up the stack.
@GAtom22 GAtom22 requested a review from MalteHerrmann March 22, 2023 14:45
@GAtom22 GAtom22 merged commit e5bd05e into main Mar 22, 2023
@GAtom22 GAtom22 deleted the GAtom22/linting branch March 22, 2023 15:16
0a1c pushed a commit that referenced this pull request Mar 25, 2023
@0a1c 0a1c mentioned this pull request Mar 25, 2023
facs95 pushed a commit that referenced this pull request Mar 25, 2023
* fix: lint issues (#1487)

* Bump Cosmos SDK dependency to v0.46.10-ledger.1

* Update changelog and upgrade handler versions

* Add changelog entry

---------

Co-authored-by: Tom <54514587+GAtom22@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants