840 Commits

Author SHA1 Message Date
Tim Heckman
f0012d3248
Update gosec2 dependency to a tagged version (v2.3.0) (#1079)
When raising #1062 I noted that the gosec dependency had been upgraded to v2,
but needed to be pulled from `master` due to some issues with the v2.2.0 tagged
release. That was tracked in https://github.com/securego/gosec/issues/470.

They've since cut v2.3.0, so let's update to that tagged release before we
release a new version of golangci-lint.
2020-05-09 09:39:05 +03:00
Isaev Denis
2ae94ef731 dev: update issue templates 2020-05-08 00:05:41 +03:00
Denis Isaev
466f9d590b
dev: remove old issue template 2020-05-07 22:38:36 +03:00
Isaev Denis
dde09e5576 dev: update issue templates 2020-05-07 22:37:44 +03:00
Isaev Denis
d2cefe0f1e
Create CODE_OF_CONDUCT.md 2020-05-07 22:34:17 +03:00
ced42
7526c8d347
Add tests, failures and errors attributes on testsuites (#1072) 2020-05-07 17:05:10 +03:00
Denis Isaev
4eaf056399 dev: fix golangci-lint-action version 2020-05-07 15:58:10 +03:00
Denis Isaev
f59ce4c86e dev: use GITHUB_TOKEN instead of GOLANGCI_LINT_TOKEN 2020-05-07 15:48:51 +03:00
Denis Krivak
4e99c75315
Fix godot false positive for cgo export comments (#1067)
godot: fix false positive for exported cgo code
2020-05-05 18:53:06 +03:00
Soichiro Kashima
7f48cc88b8
Fix lint errors on files with //line directive (#1065)
If the target files contains `//line` directive and it indicates
a non-go file, the linter is going to handle it as a go file,
which results in failure.
The cause of this issue is that the linters (`Analyzer`s) are using
`pass.Fset.Position()`. This func returns the adjusted position using
`//line` directive.
The example project reported in #998 has `//line` directive that
indicates other non-go file.
According to the description of "Compiler Directives”
(https://golang.org/cmd/compile/#hdr-Compiler_Directives),
line directives is mainly used for reporting original positions to
the generators or something.
On linters of golangci-lint, `pass.Fset.Position()` is used just to
aggregate file names; we don't have to adjust positions.
This changes `Analyzer`s that use `pass.Fset.Position()` to aggregate
file names to use `pass.Fset.PositionFor()` with `adjusted == false`.

Relates: #998
2020-05-05 18:49: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
Wilkins
ca04ca6b59
Remove reference to golangci.com in README (#997)
This project is shutting down on the 15th April. See the blog below:
https://medium.com/golangci/golangci-com-is-closing-d1fc1bd30e0e
2020-05-05 18:26:02 +03:00
Isaev Denis
38782dd097
dev: use golangci-lint action (#1066) 2020-05-05 17:51:55 +03:00
Aleksandr Razumov
01b726a048
Merge pull request #1069 from golangci/feature/github-actions-mod-cache
dev: add mod cache in gh actions
2020-05-04 15:51:57 +03:00
Aleksandr Razumov
908d91b088
dev: update cache key 2020-05-04 15:42:36 +03:00
Aleksandr Razumov
04f51a5cf4
dev: use setup-go@v2 and mod cache 2020-05-04 15:17:49 +03:00
Aleksandr Razumov
3e55c710d4
dev: remove go 1.12 from workflow 2020-05-04 15:15:54 +03:00
Aleksandr Razumov
bf7eef042b
Merge pull request #1068 from tetafro/unshallow
Fix CI
2020-05-04 14:57:23 +03:00
Denis Krivak
403c2022fc Add unshallow to CI 2020-05-04 14:27:18 +03:00
Isaev Denis
52c9b88c25
reduce mem. usage of unused and update staticcheck (#1063)
The primary improvement is in early clearing of
analyzed package's TypeInfo, facts, etc for
whole program analyzers (`unused`). Clear it when it
becomes unused and GC collects them early. Initially this
clearing was performed for all analyzers except `unused`.

Update staticcheck from v0.0.1-2019.2.3 to v0.0.1-2020.1.4

Also in this commit:
  * speed up loading packages from export data (2.5s -> 2.1s for std)
    by not using mutex for export data since it was allowed in
    x/tools#07722704da13
  * make an order of execution of linters stable
  * update renameio and robustio
  * use robustio in caching

Relates: #987, #994, #995, #1011
2020-05-03 15:20:17 +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
Denis Isaev
5c2e8d47f8
Revert "dev: don't run CI on go.12 (#1060)"
This reverts commit e7e2b9e7e5c4987e4d44c5fca7d42d2a1854c789.
2020-05-03 15:16:51 +03:00
Tim Heckman
60fd647987
Update gosec linter to v2; add .test files to .gitignore (#1062)
This change updates the `gosec` linter to its v2 version. It seems like v2
maintained API compatibility for the functionality we use, so we only needed to
update the dependency and imports.

Please note, this does not use a tagged version of `gosec` and instead is the
latest `master` commit due to this issue: https://github.com/securego/gosec/issues/470.
Once this issue is resolved we should update `gosec` to a tagged release.

This also adds a line to the `.gitignore` file, to ignore the `.test` output
files that get generated by `go test`. This could accidentally get left behind,
so no use committing binary files.

Fixes #1052
2020-05-03 14:05:00 +03:00
Isaev Denis
02a4077af9
docs: add issues.include param to .golangci.example.yml (#1061) 2020-05-02 18:12:46 +03:00
Isaev Denis
e7e2b9e7e5
dev: don't run CI on go.12 (#1060)
Also, update node.js version for CI
2020-05-02 18:08:15 +03:00
Isaev Denis
d95671cc1b
docs: add exclude-case-sensitive to .golangci.example.yml (#1058) 2020-05-02 17:57:30 +03:00
Isaev Denis
b5617209b4
dev: update js deps (#1059)
Fix js security issues by:
cd tools && npm install && npm audit fix
2020-05-02 17:56:47 +03:00
Aleksandr Razumov
ca9a53c7f8
Merge pull request #1057 from tetafro/master
Update godot linter
2020-05-02 14:02:59 +03:00
Denis Krivak
ca853d1515 Fix readme 2020-05-02 12:30:41 +03:00
Denis Krivak
7fe9a44fc7 Fix indentetion issue in godot linter 2020-05-02 12:25:59 +03:00
Aleksandr Razumov
1b9f29a304
dev: update changelog 2020-05-01 18:20:37 +03:00
Aleksandr Razumov
6bd10d01fd
dev: prepare v1.26.0
GIT_TAG=v1.26.0 make README.md
v1.26.0
2020-05-01 18:17:09 +03:00
Aleksandr Razumov
49b3993cc9
Merge pull request #1050 from tetafro/master
Update godot linter
2020-04-30 03:22:00 +03:00
Aleksandr Razumov
eeff3902d4
Merge pull request #837 from ashanbrown/asb/nolintlint-internal
Add nolintlint linter as internal linter
2020-04-30 03:20:28 +03:00
Andrew Shannon Brown
ef44e11e17
Merge branch 'master' into asb/nolintlint-internal 2020-04-29 15:27:35 -07:00
Denis Krivak
7f4a711ce6 Update godot linter. 2020-04-29 20:27:23 +03:00
Aleksandr Razumov
224515a9ab
dev: generate readme 2020-04-28 01:09:05 +03:00
Aleksandr Razumov
5db67a5564
Merge pull request #1019 from tdakkota/feature/add-go-err13-support
Add go-err113 linter support
2020-04-28 01:08:26 +03:00
tdakkota
0d95fafefc feat: add go-err113 linter support 2020-04-27 21:37:34 +03:00
Aleksandr Razumov
07374ce09b
dev: prepare v1.25.1
GIT_TAG=v1.25.1 make README.md
v1.25.1
2020-04-27 20:32:42 +03:00
Aleksandr Razumov
c0618b0593
Merge pull request #1049 from golangci/unused-fix-mode
Fix unused in "fix" mode
2020-04-27 20:18:54 +03:00
Aleksandr Razumov
56f2b7d59d
fixer: add warning about possible line range issue 2020-04-27 20:11:42 +03:00
Aleksandr Razumov
3deb9d80ab
unused: check line range before suggesting fix
Fix #1048
2020-04-27 19:59:38 +03:00
Aleksandr Razumov
1353b60074
test: add unused testdata for fix 2020-04-27 19:19:12 +03:00
Aleksandr Razumov
c4e40f1968
readme: generate 2020-04-27 13:23:58 +03:00
Aleksandr Razumov
d90ec7361d
Merge branch 'rung-upgrade-gosec' 2020-04-27 13:11:28 +03:00
Aleksandr Razumov
397a6a6732
Merge branch 'upgrade-gosec' of https://github.com/rung/golangci-lint into rung-upgrade-gosec 2020-04-27 13:07:03 +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
Aleksandr Razumov
4a3e9fd2bb
Merge pull request #1045 from JohnStarich/feature/include-excludes
Re-enable default excludes by ID
2020-04-26 00:31:01 +03:00
John Starich
36d8d881f9 Preserve API backward compatibility 2020-04-25 14:14:42 -05:00