121 Commits

Author SHA1 Message Date
Romanos
1a2a672644
Allow for serializing multiple golangci-lint invocations (#1302)
By default, golangci-lint fails after five seconds if another instance
is running. It is possible to disable that, but the discussion around
whether the cache is safe to use concurrently is not exactly full of
confidence. Add a flag that allows golangci-lint to wait forever
instead of failing.

see #1301
2020-08-28 14:06:28 +08:00
Sergey Vilgelm
a35fd6e91a
Support short and json formats for version cmd (#1315) 2020-08-20 08:57:41 -05:00
Oleg Butuzov
6e7c317610
Sorting result.Issues implementation (golangci/golangci-lint#1217) (#1218) 2020-07-12 16:35:08 -05:00
Joe Wilner
6550984878
Configure path prefix via processor abstraction (#1226) 2020-07-11 09:14:52 +10:00
sonata
b98fda6f34
Enable linters for golangci-lint (#1221)
* Enable linters for golangci-lint

* Remove unused nolint

* Fix lint
2020-07-10 10:50:06 +09:00
Isaev Denis
cb58d1f82e
speed up CI and golangci-lint (#1070)
Run CI on mac os only with go1.13 and on windows only on go1.14.
Speed up tests. Introduce --allow-parallel-runners.
Block on parallel run lock 5s instead of 60s.
Don't invalidate analysis cache for minor config changes.
2020-05-09 15:15:34 +03:00
Isaev Denis
279b6d62d3
speed up a bit (#1064)
Ensure that `unused` is always the last
in execution order. It can speed up packages loading
a bit.

Refactor enabled linters set to remove extra logging.

Relates: #944
2020-05-05 18:45:19 +03:00
Andrew Shannon Brown
909f628d75 Add linter for nolint
Linter can check that nolint statements are properly formatted and also that all
nolint statements are used.
2020-04-26 20:20:17 -07:00
John Starich
c55e7614d4 Re-enable default excludes by ID 2020-04-25 13:57:57 -05:00
Aleksandr Razumov
e2b927f029
Merge pull request #1036 from iwankgb/exclude-case-sensitive
Adding case-sensitive exclude processor
2020-04-24 12:48:42 +03:00
Maciej "Iwan" Iwanowski
794a464435
Improving flag help message
Signed-off-by: Maciej "Iwan" Iwanowski <maciej.iwanowski@critical.today>
2020-04-23 09:36:25 +02:00
Maciej "Iwan" Iwanowski
a68b411e4a
Adding case-sensitive exclude processor
Signed-off-by: Maciej "Iwan" Iwanowski <maciej.iwanowski@critical.today>
2020-04-22 18:40:10 +02:00
Viktoras Makauskas
d7222c7d38 Adding github actions output format 2020-04-10 23:46:19 +03:00
Daniel Helfand
a999403d3a change increase to increasing in timeout error 2020-02-18 11:42:58 -05:00
Carlton Henderson
bec09851bf
fix #869 by removing lock file after unlocking (#947) 2020-02-04 23:47:39 +03:00
Isaev Denis
6237e59c97
dev: use goprintffuncname, gomnd and rowserrcheck (#927)
Order linters in config in alphabetical order.
Support gomnd configuration.
2020-01-19 19:55:29 +03:00
to6ka
d137c2e18c make uniq by line configurable (#920) 2020-01-19 16:49:46 +03:00
David Braley
be3c688da4 I473 (#841)
Support custom linters integration by plugins

Co-authored-by: Isaev Denis <idenx@yandex.com>
2020-01-08 13:51:55 +03:00
Trevor Pounds
c1673d2277 Add zsh completion command.
Fixes #862
2019-12-30 10:15:31 -05:00
Trevor Pounds
60c55133a6 Fix import order. 2019-12-30 09:05:39 -05:00
Sascha Grunert
f3e349fb5c Propagate error when linter cannot be run
We now return an error if any linter is unable to run to
not exit on 0 in that case.

Closes #451

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-12-29 16:52:01 -05:00
Denis Isaev
2346cd8e56
fix json report Enabled field 2019-10-21 22:57:53 +03:00
Denis Isaev
df279922f6
just hide --deadline, don't deprecate 2019-10-15 20:46:12 +03:00
Daniel Caballero
98f60ebaa3 deadline is now deprecated, but should be taking its value from the configuration if set (#822)
* test that demostrates that deadline is not working if comes from the config

* overriding timeout with deadline when only deadline is different from its default value

* tests were not passing. default value for Deadline, that now only comes from config, is 0. Plus static check is going to fail because of deprecated cfg used

* golangci should use the latest golangci-lint version, that is the one deprecating deadline in favour of timeout

* README updated - looks the ci config in this project is used to generate usage instructions.. great!
2019-10-15 14:11:14 +03:00
Peter Štibraný
d47b6f5e48 Exposed modules-download-mode as a command line option (#781)
* Exposed modules-download-mode as a command line option

* Split line into two.

* Regenerated README.md file
2019-10-14 22:21:37 +03:00
Isaev Denis
fa69ddfc14
fix not cross-os file lock (#818) 2019-10-14 19:46:59 +03:00
Isaev Denis
64b62667c0
Lock by flock to prevent parallel runs (#812) 2019-10-13 18:10:22 +03:00
Isaev Denis
9ba730e989
Make incremental analysis (#808)
Cache linting results. Reanalyze only changed packages
and packages tree depending on them.

Fixes #768, fixes #809
2019-10-13 17:40:51 +03:00
Isaev Denis
ca6effbeec
dev: discourage bad practices (#803) 2019-10-12 12:36:03 +03:00
Denis Titusov
0cc87df732 Rename deadline option to timeout and mark deadline as deprecated. (#793) 2019-10-08 09:37:54 +03:00
M. Ángel
5e54b3334e Add version command to print golangci-lint version
Fixes #675
2019-10-01 18:13:24 -04:00
Trevor Pounds
6d786b50ae Group imports by package. 2019-10-01 18:09:47 -04:00
Isaev Denis
df4f6766ba
reduce 1.5x memory usage on large repos on repeated runs (#764)
Get rid of AST cache: load AST when needed. Optimize memory allocations
for go/analysis actions.

Relates: #337
2019-10-01 14:52:00 +03:00
Isaev Denis
95ec0cf21e
dramatically reduce memory usage (#758)
Run all linters per package. It allows unloading package data when it's
processed. It dramatically reduces memory (and CPU because of GC) usage.

Relates: #337
2019-09-30 16:19:41 +03:00
Denis Isaev
3aade55e05 Reduce memory usage of go/analysis 2019-09-23 09:52:54 +03:00
Isaev Denis
6a979fb40d
Update staticcheck and cache go/analysis facts (#699)
* update staticcheck

Don't fork staticcheck: use the upstream version.
Remove unneeded SSA loading.

* Cache go/analysis facts

Don't load unneeded packages for go/analysis.
Repeated run of go/analysis linters now 10x faster
(2s vs 20s on this repo) than before.
2019-09-17 08:42:16 +03:00
Isaev Denis
c9a9255238
Speed up packages loading (#693)
Don't perform extra go env calls in go/packages.
Load only needed go env vars in golangci-lint.
Stay in sync by enabled analyzers in go vet: remove nilness and
atomicalign analyzers, add errorsas analyzer.
Don't build SSA for govet.

Standalone govet runs 25% faster than before. All runs can be 5-10% faster
than before.
Relates: #208
2019-09-14 18:48:18 +03:00
Isaev Denis
f1c1dbfab4
Feature/enable autofix on whitespace (#674)
The whitespace linter was added in #673. Enable it and fix found issues.
Add auto-fixing to the whitespace linter.
2019-09-10 16:56:44 +03:00
Denis Isaev
5fb91e6434
docs: document bash completion in README
Also, change command `golangci-lint completion`
  to `golangci-lint completion bash`.
2019-09-10 12:06:10 +03:00
Christoph Blecker
91e90eba6b Add support for bash completions (#640) 2019-09-10 11:30:02 +03:00
Denis Isaev
bad04bb737
dev: regenerate README.md after #630
Also, output help for the new option in a more compact way.
2019-09-10 11:17:18 +03:00
Sean DuBois
f312a0fc4e fix #416: Add skip-dirs-use-default (#630) 2019-09-10 11:14:25 +03:00
Isaev Denis
6864b2f764
dev: enable funlen on repo (#668) 2019-09-09 18:07:09 +03:00
Denis Isaev
4ba2155996 fix #529: exit with code 7 when error was logged 2019-06-10 11:44:19 +03:00
Denis Isaev
3d78f64b60 fix #522: run misspell in text mode
Treat Go source files as plain text files by misspell: it allows detecting
issues in strings, variable names, etc. Also, it's the default mode of
a standalone misspell tool.

Also, implement richer and more stable auto-fix of misspell issues:
now it can fix multiple issues in one line.
2019-06-09 20:14:19 +03:00
Sonia Hamilton
5c86bfc905 junit-xml output 2019-06-09 13:23:17 +03:00
Denis Isaev
396a04630d dev: improve memory tracking 2019-03-31 22:33:18 +03:00
Denis Isaev
f516771a92 Fix #415: sort linters list in help commands 2019-03-18 08:46:13 +03:00
Denis Isaev
8c1237b667 Use the newest go vet
The newest go vet based on go/analysis
2019-03-17 23:12:44 +03:00
Ben Paxton
f13d8387d3 fix help generation; update README 2019-03-17 15:27:45 +03:00