Skip to content
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

gosec: convert global settings as map with proper key type #3779

Merged
merged 8 commits into from
Apr 21, 2023

Conversation

bcho
Copy link
Contributor

@bcho bcho commented Apr 15, 2023

Fix #3778

gosec's global settings is using following type:

map[gosec.GlobalOption]string{}

In current implementation, the gosec global settings from golangci-lint's linters-settings will not be converted to the correct type as above.

To fix this issue, this pull request refactored the *config.GoSecSetting to gosec.Config implementation to be global option aware.

@boring-cyborg
Copy link

boring-cyborg bot commented Apr 15, 2023

Hey, thank you for opening your first Pull Request !

@CLAassistant
Copy link

CLAassistant commented Apr 15, 2023

CLA assistant check
All committers have signed the CLA.

pkg/golinters/gosec.go Outdated Show resolved Hide resolved
@ldez ldez added the linter: update Update the linter implementation inside golangci-lint label Apr 15, 2023
@bcho bcho requested a review from alexandear April 15, 2023 11:53
@bcho
Copy link
Contributor Author

bcho commented Apr 17, 2023

@alexandear could you take a look? Thank you!

@ldez ldez self-requested a review April 17, 2023 14:08
@bcho
Copy link
Contributor Author

bcho commented Apr 20, 2023

@alexandear / @ldez would you like to review this PR? I am waiting for this fix to enable golangci-lint in our project...

@alexandear
Copy link
Member

alexandear commented Apr 20, 2023

LGTM.

But I haven't permission to merge.

@ldez
Copy link
Member

ldez commented Apr 21, 2023

@alexandear you have to read better:

Screenshot 2023-04-21 at 22-12-10

At least 2 approving reviews are required by reviewers with write access.

You are in the team so you can approve (instead of just putting a comment).

@ldez ldez changed the title fix: convert gosec global settings as map with proper key type gosec: convert global settings as map with proper key type Apr 21, 2023
@ldez ldez added the bug Something isn't working label Apr 21, 2023
@ldez ldez merged commit 52edd01 into golangci:master Apr 21, 2023
14 checks passed
@bcho bcho deleted the fix-gosec-global-option branch April 22, 2023 08:49
@bcho
Copy link
Contributor Author

bcho commented Apr 22, 2023

hi, thanks for merging this PR. @ldez when will we have a new release?

bcho added a commit to bcho/golangci-lint that referenced this pull request Apr 28, 2023
@ldez ldez added this to the v1.53 milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working linter: update Update the linter implementation inside golangci-lint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gosec: global options are not being honored
4 participants