Skip to content

Commit

Permalink
Format files with gofumpt to fix linting warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
johnboyes authored Feb 10, 2024
1 parent 064a3e3 commit fd816d3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions internal/github/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,10 +127,9 @@ func (a *Action) pullRequestNumber() int {
func (a *Action) outputResult(result string) {
labelCheckOutput := fmt.Sprintf("label_check=%s", result)
gitHubOutputFileName := filepath.Clean(os.Getenv("GITHUB_OUTPUT"))
githubOutputFile, err := os.OpenFile(gitHubOutputFileName, os.O_APPEND|os.O_WRONLY, 0644)
githubOutputFile, err := os.OpenFile(gitHubOutputFileName, os.O_APPEND|os.O_WRONLY, 0o644)

Check failure on line 130 in internal/github/action.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] internal/github/action.go#L130

G302: Expect file permissions to be 0600 or less (gosec)
Raw output
internal/github/action.go:130:27: G302: Expect file permissions to be 0600 or less (gosec)
	githubOutputFile, err := os.OpenFile(gitHubOutputFileName, os.O_APPEND|os.O_WRONLY, 0o644)
	                         ^
panic.IfError(err)
_, err = githubOutputFile.WriteString(labelCheckOutput)

if err != nil {

Check failure on line 133 in internal/github/action.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] internal/github/action.go#L133

only one cuddle assignment allowed before if statement (wsl)
Raw output
internal/github/action.go:133:2: only one cuddle assignment allowed before if statement (wsl)
	if err != nil {
	^
closingErr := githubOutputFile.Close()

Expand Down
10 changes: 5 additions & 5 deletions internal/github/action_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,25 @@ import (
"github.com/agilepathway/label-checker/internal/error/panic"
)

//nolint: gochecknoglobals
//nolint:gochecknoglobals
var integration = flag.Bool(
"integration",
false,
"Make calls to real external services. Requires INPUT_REPO_TOKEN environment variable.")

//nolint: gochecknoglobals
//nolint:gochecknoglobals
var enterpriseCloud = flag.Bool(
"enterprise-cloud",
false,
"Run the label checker against GitHub Enterprise Cloud instead of standard GitHub")

//nolint: gochecknoglobals
//nolint:gochecknoglobals
var enterpriseServer = flag.Bool(
"enterprise-server",
false,
"Run the label checker against GitHub Enterprise Server instead of standard GitHub")

// nolint: lll
//nolint:lll
const (
EnvGitHubRepository = "GITHUB_REPOSITORY"
EnvGitHubEventPath = "GITHUB_EVENT_PATH"
Expand Down Expand Up @@ -91,7 +91,7 @@ const (

type specifyChecks func()

// nolint: lll, funlen, dupl
//nolint:lll,funlen,dupl
func TestLabelChecks(t *testing.T) {
tests := map[string]struct {
prNumber int
Expand Down

0 comments on commit fd816d3

Please sign in to comment.