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

chore(lint): fix all linter issues; add return check; re-enable in CI #6112

Merged
merged 13 commits into from
Aug 30, 2023

Conversation

p0mvn
Copy link
Member

@p0mvn p0mvn commented Aug 18, 2023

Closes: ##6111, #5984

What is the purpose of the change

One of the previous PRs broke linter in CI. As a result, we have a lot of local failures. This PR fixes all of them

Additionally, it adds a new arg check linter via revive

Lastly, it also removes a depguard linter. This linter configures an allow and a deny list of imports. Currently, we don't have that configured and there are numerous failures. Personally, I don't see it as something useful. If someone wants it, please configure it in a separate PR.

No changelog label is set as no exported API is broken.

Testing and Verifying

This change is already covered by existing tests

Documentation and Release Note

  • Does this pull request introduce a new feature or user-facing behavior changes?
  • Changelog entry added to Unreleased section of CHANGELOG.md?

Where is the change documented?

  • Specification (x/{module}/README.md)
  • Osmosis documentation site
  • Code comments?
  • N/A

@github-actions github-actions bot added C:CLI C:x/gamm Changes, features and bugs related to the gamm module. T:CI C:x/superfluid C:app-wiring Changes to the app folder C:simulator Edits simulator or simulations C:x/twap Changes to the twap module C:x/concentrated-liquidity labels Aug 18, 2023
@p0mvn p0mvn added V:state/compatible/backport State machine compatible PR, should be backported A:backport/v17.x backport patches to v17.x branch A:no-changelog labels Aug 18, 2023
@p0mvn p0mvn marked this pull request as ready for review August 18, 2023 13:02
x/twap/store.go Outdated Show resolved Hide resolved
Copy link
Member

@mattverse mattverse left a comment

Choose a reason for hiding this comment

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

LGTM

.golangci.yml Show resolved Hide resolved
- name: function-result-limit
severity: warning
disabled: false
arguments: [4]
Copy link
Member

Choose a reason for hiding this comment

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

just curious, what's the args 4 here?

Copy link
Member Author

Choose a reason for hiding this comment

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

It limits the number of returns to 4. I added a comment to explain this

.golangci.yml Show resolved Hide resolved
@ValarDragon
Copy link
Member

I'm happy for you to just merge this @p0mvn when things are ready

@p0mvn p0mvn added A:backport/v18.x backport patches to v18.x branch A:backport/v19.x backport patches to v19.x branch and removed A:backport/v17.x backport patches to v17.x branch labels Aug 28, 2023
@p0mvn p0mvn force-pushed the roman/max-return-linter branch from 80170b7 to c19f808 Compare August 30, 2023 19:43
@p0mvn p0mvn merged commit 714f573 into main Aug 30, 2023
@p0mvn p0mvn deleted the roman/max-return-linter branch August 30, 2023 21:07
mergify bot pushed a commit that referenced this pull request Aug 30, 2023
…#6112)

* linter: max return values

* updates

* fix all linter errors

* attempt to fix linter in CI

* remove depguard

* godocs

* move unused twap helper to test export

* bug

* bring back getAllHistoricalPoolIndexedTWAPs and add nolint

* Update .golangci.yml

* fix more issues

* conflict

* new lints

(cherry picked from commit 714f573)

# Conflicts:
#	x/concentrated-liquidity/simulation/sim_msgs.go
#	x/concentrated-liquidity/swaps.go
#	x/incentives/keeper/distribute.go
#	x/superfluid/keeper/epoch.go
#	x/twap/store.go
mergify bot pushed a commit that referenced this pull request Aug 30, 2023
…#6112)

* linter: max return values

* updates

* fix all linter errors

* attempt to fix linter in CI

* remove depguard

* godocs

* move unused twap helper to test export

* bug

* bring back getAllHistoricalPoolIndexedTWAPs and add nolint

* Update .golangci.yml

* fix more issues

* conflict

* new lints

(cherry picked from commit 714f573)

# Conflicts:
#	x/concentrated-liquidity/swaps.go
#	x/incentives/keeper/distribute.go
nicolaslara pushed a commit that referenced this pull request Aug 31, 2023
…#6112)

* linter: max return values

* updates

* fix all linter errors

* attempt to fix linter in CI

* remove depguard

* godocs

* move unused twap helper to test export

* bug

* bring back getAllHistoricalPoolIndexedTWAPs and add nolint

* Update .golangci.yml

* fix more issues

* conflict

* new lints
p0mvn added a commit that referenced this pull request Sep 1, 2023
p0mvn added a commit that referenced this pull request Sep 1, 2023
p0mvn added a commit that referenced this pull request Sep 1, 2023
… (backport #6112) (#6243)

Co-authored-by: Roman <roman@osmosis.team>
p0mvn added a commit that referenced this pull request Sep 1, 2023
… (backport #6112) (#6244)

Co-authored-by: Roman <roman@osmosis.team>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A:backport/v18.x backport patches to v18.x branch A:backport/v19.x backport patches to v19.x branch A:no-changelog C:app-wiring Changes to the app folder C:CLI C:simulator Edits simulator or simulations C:x/concentrated-liquidity C:x/gamm Changes, features and bugs related to the gamm module. C:x/incentives C:x/superfluid C:x/twap Changes to the twap module T:CI V:state/compatible/backport State machine compatible PR, should be backported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants