Giter Site home page Giter Site logo

black-06 / intellij-plugin-golangci-lint Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xxpxxxxp/intellij-plugin-golangci-lint

0.0 0.0 0.0 1.18 MB

GolangCI-Lint integration for IDEA

License: GNU General Public License v3.0

Java 15.61% Kotlin 81.32% HTML 3.08%

intellij-plugin-golangci-lint's Introduction

Publish Issues License Version #Download

Intellij/Goland Linter Inspection Plugin

Write code, write better code
All credit goes to GolangCI-Lint authors.

================================

Heads up!

In case of warning: Please make sure no syntax or config error
Please run go mod tidy to refresh deps

How to use

After the plugin installed, you will see a popup on IDEA startup, otherwise please go to settings manually:

A golangci-lint executable is required. 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.

Setting Guide

  • I have a Go project as root project
    The default setting works perfectly
  • I'm using Intellij Ultimate, I have a Go project nested in sub-dir
    Select Project Root to the Go project path
  • I have multiple Go sub-projects in the root project
    Uncheck Project Root. Be aware that only the config file directly under the project root will be used.
  • I want to use a config file not under root project
    Select Using config: to the config file

WSL Guide (Windows Subsystem for Linux)

Please make sure GOROOT is set in IDE before config plugin settings.
If you get typecheck error even with successful go build, please install gcc inside WSL:

# Ubuntu/Debian
sudo apt install build-essential
# Arch/Manjaro
sudo pacman -S gcc

# Red Hat/Fedora/CentOS
sudo yum groupinstall 'Development Tools'
# or with dnf
sudo dnf groupinstall 'Development Tools'

For Windows Users

Please disable goimports / gofmt / gci linters. Instead, use Goland or File-Watcher to format your code.
If you still want to use those 3 linters with the plugin, download GNU diff & GNU LibIconv and put them in system PATH (eg: C:\WINDOWS).

Report Bug

  • Please kindly note down your platform (Win/Linux/Mac), IDEA/Goland version and Go version
  • If the plugin reports an error, please also copy-paste the error content

intellij-plugin-golangci-lint's People

Contributors

xxpxxxxp avatar danil42russia avatar arvenil avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.