Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit

Expand All @@ -46,7 +46,7 @@ jobs:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit

Expand Down Expand Up @@ -122,7 +122,7 @@ jobs:
pull-requests: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit

Expand Down Expand Up @@ -59,7 +59,7 @@ jobs:
hashBase64File: ${{ steps.hashes.outputs.handle }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:

steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
security-events: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit

Expand All @@ -49,7 +49,7 @@ jobs:
security-events: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit

Expand Down Expand Up @@ -77,7 +77,7 @@ jobs:
security-events: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit

Expand All @@ -41,7 +41,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit

Expand All @@ -68,7 +68,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
with:
egress-policy: audit

Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
# runs-on: ubuntu-latest
# steps:
# - name: Harden Runner
# uses: step-security/harden-runner@a90bcbc6539c36a85cdfeb73f7e2f433735f215b # v2.15.0
# uses: step-security/harden-runner@58077d3c7e43986b6b15fba718e8ea69e387dfcc # v2.15.1
# with:
# egress-policy: audit
#
Expand Down
8 changes: 6 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@ linters:

disable:
- exhaustruct
- forbidigo
- noinlineerr
- nonamedreturns
- wsl
- wsl_v5

exclusions:
warn-unused: true
Expand Down Expand Up @@ -94,6 +92,12 @@ linters:
multi-if: true
multi-func: true

wsl_v5:
disable:
- decl
- err
- leading-whitespace

issues:
max-issues-per-linter: 0
max-same-issues: 0
1 change: 1 addition & 0 deletions examples/logo_embed/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ import (

func TestMainGood( /* t */ *testing.T) {
os.Args = []string{"main"}

main()
}
1 change: 1 addition & 0 deletions examples/logo_file/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ import (

func TestMainGood( /* t */ *testing.T) {
os.Args = []string{"main"}

main()
}
1 change: 1 addition & 0 deletions examples/logo_owndata/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ import (

func TestMainGood( /* t */ *testing.T) {
os.Args = []string{"main"}

main()
}
1 change: 1 addition & 0 deletions examples/logo_simple/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ import (

func TestMainGood( /* t */ *testing.T) {
os.Args = []string{"main"}

main()
}
2 changes: 1 addition & 1 deletion geany.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func PrintSimpleWriter(writer io.Writer, values any) error {

// normally we have the program's name given as the first argument
if len(os.Args) > 0 && os.Args[0] != "" {
if _, err := fmt.Fprintf(writer, "%s\n", os.Args[0]); err != nil { //nolint:gosec // nothing wrong here
if _, err := fmt.Fprintf(writer, "%s\n", os.Args[0]); err != nil {
return fmt.Errorf("could not write program name: %w", err)
}
}
Expand Down
18 changes: 10 additions & 8 deletions geany_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func TestPrintLogo(t *testing.T) {

require.NoError(t, fErr)

defer func() { assert.NoError(t, os.Remove(tempFile.Name())) }() //nolint:gosec
defer func() { assert.NoError(t, os.Remove(tempFile.Name())) }()

save := os.Stdout
os.Stdout = tempFile
Expand All @@ -38,7 +38,7 @@ func TestPrintLogo(t *testing.T) {

assert.True(t, ok, "build info not found in debug.ReadBuildInfo")

target, targetErr := os.ReadFile(tempFile.Name()) //nolint:gosec
target, targetErr := os.ReadFile(tempFile.Name())
require.NoError(t, targetErr)

assert.Equal(t, string(target), "Logo "+buildInfo.GoVersion+"\n", "Logo does not contain go version")
Expand All @@ -50,7 +50,7 @@ func TestPrintSimple(t *testing.T) {

require.NoError(t, fErr)

defer func() { assert.NoError(t, os.Remove(tempFile.Name())) }() //nolint:gosec
defer func() { assert.NoError(t, os.Remove(tempFile.Name())) }()

save := os.Stdout
os.Stdout = tempFile
Expand All @@ -64,7 +64,7 @@ func TestPrintSimple(t *testing.T) {

assert.True(t, ok, "build info not found in debug.ReadBuildInfo")

target, targetErr := os.ReadFile(tempFile.Name()) //nolint:gosec
target, targetErr := os.ReadFile(tempFile.Name())
require.NoError(t, targetErr)

assert.Contains(t, string(target), `"GoVersion": "`+buildInfo.GoVersion+`"`)
Expand All @@ -79,30 +79,32 @@ type BrokenNIO struct {
To int
}

func (b *BrokenNIO) Read(in []byte) (n int, err error) {
func (b *BrokenNIO) Read(input []byte) (n int, err error) {
if (b.cnt >= b.From || b.From == 0) &&
(b.cnt < b.To || b.To == 0) {

b.cnt++

return 0, errors.New("broken reader")
}

b.cnt++

return len(in), nil
return len(input), nil
}

func (b *BrokenNIO) Write(in []byte) (n int, err error) {
func (b *BrokenNIO) Write(input []byte) (n int, err error) {
if (b.cnt >= b.From || b.From == 0) &&
(b.cnt < b.To || b.To == 0) {

b.cnt++

return 0, errors.New("broken writer")
}

b.cnt++

return len(in), nil
return len(input), nil
}

func TestBrokenLogoWriter(t *testing.T) {
Expand Down
Loading