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

multi: add linters for switch exhaustiveness, if-else chains, and err handling #817

Merged
merged 7 commits into from
Mar 4, 2024

Conversation

jharveyb
Copy link
Contributor

Inspired by #812. These are some lints that felt useful for keeping style consistent, as well as how we use switch.

I've added fixes for a few small issues, and lint runtime (both cold and hot module cache) on my machine increased from 13.5 to ~16 seconds.

I'm not sure which linters could be used to replicate the gopls analyzers I'm using locally, but those fixes were less important IMO.

Copy link
Member

@guggero guggero left a comment

Choose a reason for hiding this comment

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

Very nice, LGTM 🎉

itest/send_test.go Outdated Show resolved Hide resolved
tapfreighter/chain_porter.go Show resolved Hide resolved
Copy link
Member

@Roasbeef Roasbeef left a comment

Choose a reason for hiding this comment

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

LGTM 🪷

proof/courier.go Show resolved Hide resolved
tapdb/assets_store.go Show resolved Hide resolved
jharveyb added 7 commits March 4, 2024 11:57
In this commit, we enable extra linters to check for non-exhaustive
switch statements, and if-else or switch statements that can be
simplified. We also check for improper error returns and other small
simplifications.
@jharveyb jharveyb added this pull request to the merge queue Mar 4, 2024
Merged via the queue into main with commit 4fbfc09 Mar 4, 2024
14 checks passed
@jharveyb jharveyb deleted the lint_misc_fixes branch March 4, 2024 21:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants