Commit graph

2 commits

Author SHA1 Message Date
Elle Mouton
9637a8132e
tools/linters: convert to LinterPlugin implementation
This commit introduces the `LLPlugin` type and converts the existing lll
code such that the LLPlugin implements the register.LinterPlugin
interface. This will allow us to plug it into golangci-linter as a
plugin.
2024-11-29 11:03:27 +02:00
Elle Mouton
acbcb771af
tools/linters: Add copied golangci-lint lll linter code
In this commit, we copy the implementation of the golangci-lint lll
linter which we currently use in our CI flow during the `make lint`
check. This commit copies the code mostly as is (the only exception
being the line which trims white space before checking if a line starts
with "import"), and formats it to fit our codebase guidelines. A test is
also added so that we can be sure that the following commits which
adjust the implementation have the intended results.

The custom linter is put into its own module as this is requied by the
`golangci-lint custom` when building the custom linter binary which
includes the plugin.
2024-11-29 10:44:22 +02:00