Merge pull request #1983 from gagbo/feature/golang/flycheck_ci-lint

lang/go: add flycheck-golangci-lint
This commit is contained in:
Henrik Lissner 2019-11-21 17:21:52 -05:00 committed by GitHub
commit a88a3e12b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 0 deletions

View file

@ -27,6 +27,7 @@ This module adds [[https://golang.org][Go]] support.
+ [[../../editor/file-templates/templates/go-mode][File templates]] + [[../../editor/file-templates/templates/go-mode][File templates]]
+ [[https://github.com/hlissner/doom-snippets/tree/master/go-mode][Snippets]] + [[https://github.com/hlissner/doom-snippets/tree/master/go-mode][Snippets]]
+ Generate testing code (~go-gen-test~) + Generate testing code (~go-gen-test~)
+ Code checking (~flycheck-golangci-lint~)
** Module Flags ** Module Flags
+ =+lsp= Enables integration for the gopls LSP server. + =+lsp= Enables integration for the gopls LSP server.
@ -39,6 +40,7 @@ This module adds [[https://golang.org][Go]] support.
+ [[https://github.com/brantou/emacs-go-tag][go-tag]] + [[https://github.com/brantou/emacs-go-tag][go-tag]]
+ [[https://github.com/mdempsky/gocode][company-go]]* + [[https://github.com/mdempsky/gocode][company-go]]*
+ [[https://github.com/s-kostyaev/go-gen-test][go-gen-test]] + [[https://github.com/s-kostyaev/go-gen-test][go-gen-test]]
+ [[https://github.com/weijiangan/flycheck-golangci-lint][flycheck-golangci-lint]] (if =:tools flycheck= is enabled)
* Prerequisites * Prerequisites
** Go ** Go
@ -84,6 +86,10 @@ go get -u github.com/cweill/gotests/...
go get -u github.com/fatih/gomodifytags go get -u github.com/fatih/gomodifytags
#+END_SRC #+END_SRC
+ ~golangci-lint~ (optional: for flycheck to integrate golangci-lint results)
it is recommended to *not* use go get to install this one, check the
[[https://github.com/golangci/golangci-lint#binary-release][documentation]].
* TODO Features * TODO Features
* TODO Configuration * TODO Configuration

View file

@ -69,3 +69,8 @@
:config :config
(set-company-backend! 'go-mode 'company-go) (set-company-backend! 'go-mode 'company-go)
(setq company-go-show-annotation t)) (setq company-go-show-annotation t))
(use-package! flycheck-golangci-lint
:when (featurep! :tools flycheck)
:hook (go-mode . flycheck-golangci-lint-setup)
:config (setenv "GO111MODULE" "on"))

View file

@ -10,3 +10,6 @@
(when (featurep! :completion company) (when (featurep! :completion company)
(package! company-go)) (package! company-go))
(when (featurep! :tools flycheck)
(package! flycheck-golangci-lint))