Skip to content

Fix gosec errors and enable gosec linter#59

Merged
inteon merged 1 commit into
cert-manager:mainfrom
inteon:fix_linters
May 13, 2024
Merged

Fix gosec errors and enable gosec linter#59
inteon merged 1 commit into
cert-manager:mainfrom
inteon:fix_linters

Conversation

@inteon

@inteon inteon commented Apr 26, 2024

Copy link
Copy Markdown
Member

Checked all found issues and applied fixes/ #nosec statements.
Now that all issues are fixed, I removed the gosec linter from the ignored section so future issues will be detected.

NOTE FOR REVIEWER:
Use make verify-golangci-lint to quickly run golangci-lint.

I had to mix the comments with the code to make sure the nosec comments were picked up by gosec (see securego/gosec#278 (comment)).

Signed-off-by: Tim Ramlot <42113979+inteon@users.noreply.github.com>
@cert-manager-prow cert-manager-prow Bot added dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 26, 2024
Comment thread pkg/renew/renew.go
Comment thread pkg/status/certificate/certificate.go

@maelvls maelvls left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mixing comments and logic makes it hard to read the logic (at least to me). In some places, you went with line comments, such as:

	// #nosec G204
	cmd := exec.Command(os.Args[0], "-test.run="+t.Name())

But in other places, you went with inline comments that either make it hard to read logic or hides it to the far right of text editors

@maelvls

maelvls commented May 13, 2024

Copy link
Copy Markdown
Member

/approve
/lgtm

@cert-manager-prow cert-manager-prow Bot added the lgtm Indicates that a PR is ready to be merged. label May 13, 2024
@cert-manager-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maelvls

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cert-manager-prow cert-manager-prow Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 13, 2024
@inteon inteon dismissed maelvls’s stale review May 13, 2024 13:53

The PR description was updated with the reason for this comment weirdness.

@inteon inteon merged commit 656eb61 into cert-manager:main May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates that all commits in the pull request have the valid DCO sign-off message. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants