Skip to content

Commit

Permalink
chore(lint): Disable funlen for test functions (#1993)
Browse files Browse the repository at this point in the history
This adds a regular expression that matches `func Test...` or
`func (suite *Suite) Test...` style functions and disables the length
check. An example from e2e tests that failed lint:

`func (suite *IntegrationTestSuite) TestEip712BasicMessageAuthorization()`
  • Loading branch information
nddeluca authored Aug 7, 2024
1 parent edf2935 commit ab10ce6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ linters:
# - whitespace
- wrapcheck

issues:
exclude-rules:
# Disable funlen for "func Test..." or func (suite *Suite) Test..." type functions
# These functions tend to be descriptive and exceed length limits.
- source: "^func (\\(.*\\) )?Test"
linters:
- funlen

linters-settings:
errcheck:
Expand Down

0 comments on commit ab10ce6

Please sign in to comment.