Skip to content

Custom ci lints#4841

Open
mdulin2 wants to merge 13 commits into
wormhole-foundation:mainfrom
mdulin2:custom-ci-lints
Open

Custom ci lints#4841
mdulin2 wants to merge 13 commits into
wormhole-foundation:mainfrom
mdulin2:custom-ci-lints

Conversation

@mdulin2

@mdulin2 mdulin2 commented May 27, 2026

Copy link
Copy Markdown
Contributor

The PR is introducing the capability for custom linters in Wormhole:

  • Adds a new folder on the top level named linters
  • Adds the channelcheck linter but doesn't enable it.
  • Replaces the standard golangci-lint binary with a build of our linter for both local testing and in CI. This new flow will allow us to add custom linters to the Wormhole repository in the future.
  • Adds linter runs for the linter modules themselves, the node directory, and the SDK. Wormchain historically hasn't been linted and it would likely require a lot of work to do this. So, not making this change currently.

channelcheck is NOT enabled in this PR to limit the number of files being touched. This will be enabled in a separate follow-up PR. There are comments labeled Note on channel capacity that will be converted either into nolint comments or into code that satisfies the linter.

Comment thread scripts/lint.sh Outdated
@johnsaigle

Copy link
Copy Markdown
Contributor

Adding a note here to cross-reference this PR with two other open PRs which introduce changes to golangci-lint this PR will likely conflict with.

#4701 (comment)
#4765

@socket-security

socket-security Bot commented Jun 17, 2026

Copy link
Copy Markdown

Dependency limit exceeded — report not shown.

This pull request scan exceeded the 10,000-dependency limit applied to this scan, so the results are incomplete and may be inaccurate. To avoid reporting false positives, Socket has not posted a report.

Upgrade your plan to raise the dependency limit and get complete reports, or view the partial scan in the dashboard.

Socket is always free for open source. If this is a non-commercial open source project, contact us to request a free Team account.

@mdulin2 mdulin2 marked this pull request as ready for review June 17, 2026 22:03
@mdulin2 mdulin2 requested a review from johnsaigle June 17, 2026 22:16

@johnsaigle johnsaigle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The linter works and I tested the new lint make targets from each of the subdirectories and via the Docker method.

I left some comments mostly around deleting a custom caching system which I don't believe is necessary given Go's built-in caching mechanism.

I also left several notes marked "suggestion" that can be ignored/resolved without comment. 👍🏻

Comment thread .github/CODEOWNERS Outdated
Comment thread linters/rules/channelcheck/go.mod Outdated
Comment thread scripts/lint.sh Outdated
Comment thread scripts/lint.sh Outdated
Comment thread linters/go.mod Outdated
Comment thread linters/rules/channelcheck/channelcheck.go
Comment thread linters/rules/channelcheck/channelcheck.go
Comment thread scripts/lint.sh
Comment thread linters/Makefile Outdated
Comment thread linters/Makefile Outdated
johnsaigle
johnsaigle previously approved these changes Jun 19, 2026

@johnsaigle johnsaigle left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ran the tests on the latest commit with and without channelcheck enabled.

djb15
djb15 previously approved these changes Jun 23, 2026

@djb15 djb15 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I didn't review the linter itself in a tonne of detail but I think the changes to the existing code look good, seems to be pretty unobtrusive and it also doesn't seem to change the developer workflow at all which is great.

The linter itself doesn't appear to do anything dangerous and the test cases cover the channel use cases we have in the monorepo so far.

@mdulin2

mdulin2 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

I messed up the git history' commits were duplicated for some reason. Changes are much cleaner now.

@johnsaigle

Copy link
Copy Markdown
Contributor

@mdulin2 looks like you need to rebase after your EVM watcher PR got merged

@mdulin2 mdulin2 requested review from djb15 and johnsaigle June 29, 2026 21:35
standalone analyzer flag (when running the `wormhole-lint` binary, using the
**Flag** name).

| Setting | Flag | Type | Default | Description |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we include CheckEmptyDefault in the table?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@mdulin2 feel free to mark my 2 comments as resolved and ignore, they are non blockers.

Comment thread linters/README.md

`channelcheck` settings:

| Setting | Type | Default | Description |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Might be better to use actual setting names (CheckBlockingSends) instead of flags (blocking)?

@SEJeff SEJeff left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why not use golangci-lint? I am unclear on why we want this vs using the industry standard linting tool and plugging any custom linters we want into it.

@johnsaigle

Copy link
Copy Markdown
Contributor

@SEJeff This is how you do that. https://golangci-lint.run/docs/plugins/module-plugins/

I agree it's a weird system that they make you recompile a custom version of golangci-lint but that appears to be the way this gets done. We also took a look at using revive instead but it has basically the same set-up, so we went this way.

@mdulin2

mdulin2 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Any thoughts from folks on this? I'd love to get this merged so that we can turn on the channel linter in the repo, as well as add other custom linters.

@johnsaigle

Copy link
Copy Markdown
Contributor

@mdulin2 I think we're good on our side, you just need codeowner review now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants