Linter Requirements
Linter Requirements
This project uses a set of linters to ensure good code quality. In order to make proper use of those linters inside an IDE, the following configuration is required.
Golangci-lint
Further information can also be found in
the golangci-lint documentation.
Visual Studio Code
In Visual Studio Code the Golang extension is required.
Adding the following lines to the Golang extension
configuration file enables all linters used in this project.
"go.lintTool": {
"type": "string",
"default": "golangci-lint",
"description": "GolangGCI Linter",
"scope": "resource",
"enum": [
"golangci-lint",
]
},
"go.lintFlags": {
"type": "array",
"items": {
"type": "string"
},
"default": ["--fast", "--fix"],
"description": "Flags to pass to GCI Linter",
"scope": "resource"
},
GoLand / IntelliJ requirements
-
Install either the GoLand or IntelliJ Integrated Development Environment (IDE) for the Go programming language, plus the Go Linter plugin.
-
The plugin can be installed via
Settings»Plugins»Marketplace, search forGo Linterand install it. Once installed, make sure that the plugin is using the.golangci.ymlfile from the root directory. -
The configuration of
Go Lintercan be found in theToolssection of the settings.
If you are on Windows, you need to install make for the above process to complete.
Note When using the make command on Windows, you may receive an
unrecognized commanderror for a command that is installed. This usually indicates thatPATHfor the binary is not set correctly).
Markdownlint
We are using markdownlint to ensure consistent styling within our Markdown files. Specifically we are using markdownlint-cli.
We are using GNU MAKE to ensure the same functionality locally and within our CI builds.
This should allow easier debugging and problem resolution.
Markdownlint execution
To verify that your markdown code conforms to the rules, run the following on your local branch:
make markdownlint
To use the auto-fix option, run:
make markdownlint-fix
Markdownlint Configuration
We use the default configuration values for markdownlint.
This means:
.markdownlint-cli2.yaml contains the rule configuration
We use the default values, so tools like markdownlint for VSCode can be used without additional configuration.