xxpxxxxp / Intellij Plugin Golangci Lint
Programming Languages
Labels
Projects that are alternatives of or similar to Intellij Plugin Golangci Lint
Intellij/Goland Linter Inspection Plugin
Write code, write better code
All credit goes to GolangCI-Lint authors.
A lot of code pieces copied from clion-clangtidy, kotlin, and Goland plugin itself.
How to use
After the plugin installed, you can see a popup on IDEA startup, or go to settings directly:
A golangci-lint executable is needed. Choose one from combobox if you already have it in your PATH, or Open...
select one from disk, or Get Latest
download one from Github release.
If you have your own .golangci.json
|.golangci.toml
|.golangci.yaml
|.golangci.yml
config file, the plugin will detect and use it.
Otherwise, select linters you need:
Click OK
, you are all set!
Please keep in mind that golangci-lint is a linter tool, it only works if your project could build (no syntax error), or it will report no issue.
Project Root Setting
- If your Go project is the root project, the default setting will work perfectly.
- If you are using Intellij Ultimate, you have a Go project which isn't the root project, but nested in directories, select
Project Root
to the Go project path. - If you have multiple Go sub-projects in the root project, uncheck
Project Root
. Be aware that only the config file directly under the root project will be used.
Go Project As Sub Folder
Skip this if you are not using config file (eg: .golangci.yml
)
If you are using Intellij, the Go project is not the root project (sub-folder nested in the root project),
and the Go project has its own golangci-lint config file,
Please select project root
to the path of Go project, in order to let the plugin correctly pick up the config file.
For Windows users
Please disable goimports / gofmt / gci linters. Use File-Watcher in IDEA.
It you insist using those 3 linters, download GNU diff & GNU LibIconv and put them in system PATH (eg: C:\WINDOWS). Normally it's missing from the system.
Report a bug
- Please note down your platform (Win/Linux/Mac), IDEA/Goland version, Go version
- If the plugin reports an error, please copy-paste the error content
What's next
- Performance improvement
- Code quality improvement