-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump github.com/golangci/golangci-lint from 1.58.1 to 1.59.0 in /internal/tools #558
Bump github.com/golangci/golangci-lint from 1.58.1 to 1.59.0 in /internal/tools #558
Conversation
Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.58.1 to 1.59.0. - [Release notes](https://github.com/golangci/golangci-lint/releases) - [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md) - [Commits](golangci/golangci-lint@v1.58.1...v1.59.0) --- updated-dependencies: - dependency-name: github.com/golangci/golangci-lint dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #558 +/- ##
=======================================
Coverage 60.64% 60.64%
=======================================
Files 40 40
Lines 1964 1964
=======================================
Hits 1191 1191
Misses 626 626
Partials 147 147 ☔ View full report in Codecov by Sentry. |
This rule was updated to check for `os.ModePerm` in v1.58.2: securego/gosec#1138.
@@ -256,7 +256,7 @@ func TestEntry(t *testing.T) { | |||
func TestReadDeleteEntries(t *testing.T) { | |||
tempDir := t.TempDir() | |||
entriesDir := filepath.Join(tempDir, config.DefaultEntriesDir) | |||
require.NoError(t, os.Mkdir(entriesDir, os.ModePerm)) | |||
require.NoError(t, os.Mkdir(entriesDir, 0750)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like a regression bug in golangci-lint.
See:
- https://github.com/golangci/golangci-lint/blob/95b8f489a2e78d424982fc167434a83817d1da80/assets/default-exclusions.json#L52
- https://golangci-lint.run/usage/configuration/
opentelemetry-go-build-tools/.golangci.yml
Line 163 in e3fd63d
- EXC0009
Can you report an issue in https://github.com/golangci/golangci-lint?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrzej-stencel bump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The linter authors seem to think of it as a bug fix:
- G306 can be easily bypassed with
os.ModePerm
securego/gosec#1126 - Catch the os.ModePerm permissions in os.WriteFile securego/gosec#1138
os.ModePerm equals 0777
, so I suppose it's a good idea to fix the test and use 0750
permissions that satisfy the linter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a problem of gosec
. golangci-lint
has a list of default exclusions and it looks like EXC0009
opentelemetry-go-build-tools/.golangci.yml
Line 164 in a0880ac
- EXC0009 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pellared After digging into this a bit (I'm not very familiar with the Go linter) I'm not sure I understand the ask.
The configuration in this repository says:
linters:
enable:
- ...
- gosec
- ...
issues:
include:
- ...
- EXC0009
- ...
The documentation is not perfectly clear (oh the double negations 🤦), but if I understand correctly, this is what it means:
- mentioning
gosec
inlinters::enable
means "please enable thegosec
linter" - mentioning
EXC0009
inissues::include
means "please remove theEXC0009
exclusion rule from the (default) list of exclusion rules", which effectively means "please disregard theEXC0009
exclusion rule", which means "please check for errors described inEXC0009
".
If we want to use the EXC0009
exclusion rule, i.e. if we want to ignore permissions errors reported by the gosec
linter, we should remove it from the issues::include
and rather add it to issues::exclude
- this is not necessary though, as EXC0009
is one of the default exclusion rules.
Or maybe I'm missing something again? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. I missed that it is include:
🤦
So the rule started to work correctly as you described. Sorry for the trouble.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pellared I've created a separate PR to fix the gosec linter violation:
A newer version of github.com/golangci/golangci-lint exists, but since this PR has been edited by someone other than Dependabot I haven't updated it. You'll get a PR for the updated version as normal once this PR is merged. |
@dependabot recreate |
Superseded by #574. |
Bumps github.com/golangci/golangci-lint from 1.58.1 to 1.59.0.
Release notes
Sourced from github.com/golangci/golangci-lint's releases.
Changelog
Sourced from github.com/golangci/golangci-lint's changelog.
Commits
2059b18
build(deps): bump github.com/securego/gosec/v2 from 2.20.0 to 5f0084eb01a9 (#...95ca3c3
dev: fix badges495321c
dev: improve issue chooser (#4747)62c83cc
build(deps): bump github.com/BurntSushi/toml from 1.3.2 to 1.4.0 (#4746)e14ae4b
build(deps): bump github.com/hashicorp/go-version from 1.6.0 to 1.7.0 (#4745)010b4f8
chore: use global security policyb99d529
feat: allow the analysis of generated files (#4740)08deff4
feat: add warning about disabled and deprecated linters (level 2) (#4742)b9868e1
chore: add html to the JSONSchema (#4737)0cb1418
build(deps): bump github.com/go-critic/go-critic from 0.11.3 to 0.11.4 (#4738)Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditions
will show all of the ignore conditions of the specified dependency@dependabot ignore this major version
will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this minor version
will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)@dependabot ignore this dependency
will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)