59 Commits

Author SHA1 Message Date
Sergey Vilgelm
4ea3adc621
Update assets and README (#1234) 2020-07-11 19:22:01 -05:00
Denis Isaev
a1e1226977
docs: list contributors 2020-05-19 14:41:16 +03:00
Isaev Denis
b49d2df623
dev: use fast_check_generated in CI (#1104) 2020-05-17 00:08:16 +03:00
Isaev Denis
e560b3f76e
dev: expand website templates during build (#1095) 2020-05-16 14:41:39 +03:00
Isaev Denis
2d4d503a79
docs: migrate README.md to a website (#1094)
Make a website https://golangci-lint.run
for golangci-lint documentation.
The website is backed by Gatsby static site generator
and deployed into Netlify.
2020-05-16 14:10:03 +03:00
Isaev Denis
55cd9f78a1
dev: generate assets/github-action-config.json (#1073)
It will be used by GitHub action `golangci-lint-action`.

Relates: golangci/golangci-lint-action#11
2020-05-09 15:30:54 +03: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
iwankgb
77e211ba75
Replacing Travis with Github actions (#1056)
Signed-off-by: Maciej "Iwan" Iwanowski <maciej.iwanowski@critical.today>
2020-05-03 15:17:41 +03:00
Aleksandr Razumov
883305174d
make: add snapshot command 2020-04-23 01:40:32 +03:00
Aleksandr Razumov
ef317c460d
dev: disable vendoring
Fix #743
2020-04-22 01:53:36 +03:00
Trevor Pounds
c46c1b3224
Update to latest x/tools (#930)
* Update to latest x/tools (2020/01/19).

Fixes #893

* Initialize vet analyzers as unexportd global vars.

Fixes #915

* Support testing Go 1.14beta1.

* ci: reset go.mod and go.sum before generated diff check

* Update to latest x/tools (2020/02/04)

Co-authored-by: Aleksandr Razumov <ar@gortc.io>
2020-02-05 01:11:14 +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
258eb9b807 Cleanup duplicate test run command. 2019-12-29 22:02:00 -05:00
Trevor Pounds
0e7f88e07b Cleanup make targets. 2019-12-29 21:35:49 -05:00
Denis Titusov
0cc87df732 Rename deadline option to timeout and mark deadline as deprecated. (#793) 2019-10-08 09:37:54 +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
Trevor Pounds
86d7c05c6b Build godownloader/goreleaser tools before use. (#744) 2019-09-25 17:26:46 +03:00
Trevor Pounds
c427c61253 Use separate go.mod/go.sum to manage tool deps. (#736)
Fixes downstream `go get` issues due to broken/invalid
transitive goreleaser dependencies.

Fixes #730
2019-09-24 21:44:57 +03:00
Trevor Pounds
a16b4d872b Use stretchr/testify to mock log.
Simplifies test log usage and removes additional
targets and dependencies to go:generate mocks.
2019-09-24 11:58:40 -04:00
Trevor Pounds
abad4c9933 Cleanup obsolete go.mod/go.sum diff. (#729)
Unnecessary since Go 1.11 is no longer supported.
2019-09-24 08:42:22 +03:00
Trevor Pounds
21fda1d67c Enable consistent GOPROXY Go 1.12/1.13 behavior. 2019-09-23 15:30:15 -04:00
Trevor Pounds
49297189a1 Manage build tools via go.mod. 2019-09-23 21:30:20 +03:00
Trevor Pounds
358ce7c20c Enable Go module support across all commands. (#717) 2019-09-21 08:35:45 +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
Will Dixon
9161de5b7d Upgrade depguard to fix performance issue with go modules (#698)
* Upgrade depguard to fix performance issue with go modules

* Fix linting error of unused function
2019-09-15 14:13:16 +03:00
Trevor Pounds
2e8d83266f Update dependencies. (#684)
* Update deps.

* Update to Node.js v10.16.3 LTS.

* Fix mock logutils generation.
2019-09-12 16:02:43 +03:00
Denis Isaev
4495f893b9
Log go/analysis panics, don't crash
go/analysis panics were propagated to main and crashed golangci-lint.
Just log them, as with other linters.
Found in #608.
2019-09-10 18:49:34 +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
Isaev Denis
c87c37210f
dev: update install.sh (#672) 2019-09-10 11:09:39 +03:00
Isaev Denis
6163a8a790
Support go1.13 (#670)
Setup Travis CI to run on go 1.12 and 1.13.
Update info about go versions in README.
Rebuild go.mod,go.sum on go1.13.
2019-09-09 21:54:56 +03:00
Duco van Amstel
0b49095bae Make generation of demo.svg deterministic (#625) 2019-09-09 17:37:06 +03:00
Denis Isaev
e39e8fb5d5 update x/tools
Significantly improve CPU and memory usage when not using SSA-powered linters.
Improve readability of go/packages errors.
Improve debugging capabilities and write doc about debugging.
2019-09-09 15:04:32 +03:00
Denis Isaev
ad9de15a58
dev: fix go1.11 builds 2019-06-09 16:24:04 +03:00
Denis Isaev
6508d1623a fix #513: don't add gofmt "with -s" if not needed
Output
  File is not `gofmt`-ed
insted of
  File is not `gofmt`-ed  with `-s`
when gofmt.simplify == false
2019-06-09 16:22:41 +03:00
Luke Shumaker
2508856219 Makefile: Be clear about exactly which files are generated, and how
This mostly aims to document how everything was generated, and the steps
necessary to re-generate the same files verbatim; the goal is to figure
out how to reproduce the files as they currently are.  The exception is
that we strip out the timestamp out of install.sh.
2019-06-05 01:04:00 -04:00
Luke Shumaker
9ce337296b Makefile: Set GO111MODULE=on for consistency, adjust tests accordingly 2019-06-05 00:52:23 -04:00
Luke Shumaker
b51d53e11e make check_generated: Also check vendor/, not just README.md 2019-06-05 00:40:04 -04:00
Hui Zhu
8319caf63f Makefile: Add target build
kata-containers's ci will re-build and re-install golangci-lint every
time it did the staic check.
So run test of golangci-lint with build will make it slow.
Add target build to make golangci-lint just build but not test.

Fixes: #458

Signed-off-by: Hui Zhu <teawater@hyper.sh>
2019-03-31 19:37:26 +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
Denis Isaev
87aae77943 Update gocritic
Fix #324, relates #314

1. Update gocritic to the latest version
2. Use proper gocritic checkers repo, old repo was archived
3. Get enabled by default gocritic checks in sync with go-critic: don't
enable performance, experimental and opinionated checks by default
4. Support of `enabled-tags` options for gocritic
5. Enable almost all gocritic checks for the project
6. Make rich debugging for gocritic
7. Meticulously validate gocritic checks config
2019-01-09 09:51:48 +03:00
Denis Isaev
4f0fddf4fe
add tests for abs path args 2018-12-22 14:16:31 +03:00
Denis Isaev
898ae4d364 fix #277, fix #260: fix crash
Fix crash because of parallel access to ssa.Program
2018-11-10 16:20:49 +03:00
Denis Isaev
8a478c47ac Prepare for #164: rename GAS to gosec
1. Rename in a backward compatible way
2. Remove gosec default exclude list because gosec is already disabled
by default.
3. Warn about unmatched linter names in //nolint directives
4. Process linter names in //nolint directives in upper case
5. Disable gosec for golangci-lint in .golangci.yml
2018-09-02 09:34:35 +03:00
Denis Isaev
6dd4f07c50
Fix file leak in lll 2018-06-29 08:28:12 +03:00
Denis Isaev
7b2a63dfa6 Fix #100: misspell linter support 2018-06-28 21:52:30 +03:00
Denis Isaev
5514c4393e Fix #17, #87: govet becomes SLOW linter by default
1. Allow govet to work in 2 modes: fast and slow. Default is slow.
In fast mode golangci-lint runs `go install -i` and `go test -i`
for analyzed packages. But it's fast only when:
  - go >= 1.10
  - it's repeated run or $GOPATH/pkg or `go env GOCACHE` is cached
  between CI builds
In slow mode we load program from source code like for another linters
and do it only once for all linters.

3. Patch govet code to warn about any troubles with the type
information. Default behaviour of govet was to hide such warnings.
Fail analysis if there are any troubles with type loading: it will
prevent false-positives and false-negatives from govet.

4. Describe almost all options in .golangci.example.yml and
include it into README. Describe when to use slow or fast mode of govet.

5. Speed up govet: reuse AST parsing: it's already parsed once by
golangci-lint.
For "slow" runs (when we run at least one slow linter) speedup by
not loading type information second time.

6. Improve logging, debug logging

7. Fix crash in logging of AST cache warnings (#118)
2018-06-18 09:47:15 +03:00
Denis Isaev
9181ca7175 Fix #78: log all warnings
1. Log all warnings, don't hide none of them
2. Write fatal messages (stop analysis) with error log level
3. Remove ugly timestamp counter from logrus output
4. Print nested module prefix in log
5. Make logger abstraction: no global logging anymore
6. Refactor config reading to config.FileReader struct to avoid passing
logger into every function
7. Replace exit codes hardcoding with constants in exitcodes package
8. Fail test if any warning was logged
9. Fix calculation of relative path if we analyze parent dir ../
10. Move Runner initialization from Executor to NewRunner func
11. Log every AST parsing error
12. Properly print used config file path in verbose mode
13. Print package files if only 1 package is analyzedin verbose mode,
  print not compiling packages in verbose mode
14. Forbid usage of github.com/sirupsen/logrus by DepGuard linter
15. Add default ignore pattern to folint: "comment on exported const"
2018-06-14 23:09:04 +03:00
Denis Isaev
b4bf038095
docs: improve FAQ and remove -i from go install command 2018-06-12 14:20:36 +03:00
Denis Isaev
6e12ea5734
docs: add FAQ entry about go install 2018-06-12 10:07:10 +03:00
Denis Isaev
2a8eec1f70
dev: add release target to Makefile 2018-06-11 10:30:29 +03:00