Skip to content

Commit 00c804c

Browse files
authored
chore: enable more linter (#688)
1 parent 8b247f5 commit 00c804c

File tree

6 files changed

+30
-2
lines changed

6 files changed

+30
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
contents: read
2020
steps:
2121
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
22+
with:
23+
persist-credentials: 'false'
2224

2325
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
2426
with:
@@ -56,6 +58,7 @@ jobs:
5658
steps:
5759
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
5860
with:
61+
persist-credentials: 'false'
5962
fetch-depth: 0
6063

6164
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
@@ -93,6 +96,9 @@ jobs:
9396
contents: read
9497
steps:
9598
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
99+
with:
100+
persist-credentials: 'false'
101+
96102
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
97103
with:
98104
go-version-file: 'go.mod'
@@ -116,6 +122,7 @@ jobs:
116122
- name: Checkout Code
117123
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
118124
with:
125+
persist-credentials: 'false'
119126
fetch-depth: 0
120127

121128
- name: Lint Code Base
@@ -124,13 +131,15 @@ jobs:
124131
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125132
MULTI_STATUS: false
126133
LINTER_RULES_PATH: .
134+
GITHUB_ACTIONS_ZIZMOR_CONFIG_FILE: ./.github/zizmor.yml
127135
VALIDATE_ALL_CODEBASE: true
128136
VALIDATE_BASH: true
129137
VALIDATE_BASH_EXEC: true
130138
VALIDATE_EDITORCONFIG: true
131139
VALIDATE_ENV: true
132-
# VALIDATE_GO_RELEASER: true
140+
VALIDATE_GO_RELEASER: true
133141
VALIDATE_GITHUB_ACTIONS: true
142+
VALIDATE_GITHUB_ACTIONS_ZIZMOR: true
134143
VALIDATE_HTML: true
135144
VALIDATE_JSON: true
136145
VALIDATE_NATURAL_LANGUAGE: true
@@ -158,6 +167,7 @@ jobs:
158167
steps:
159168
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
160169
with:
170+
persist-credentials: 'false'
161171
fetch-depth: 0
162172

163173
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0

.github/workflows/pr-check.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ on:
88
- labeled
99
- unlabeled
1010

11+
permissions: {}
12+
1113
jobs:
1214
required-labels-missing:
1315
name: required labels missing
1416
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
1519
steps:
1620
- name: check
1721
if: >-

.github/workflows/tag.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,16 @@ jobs:
2828

2929
- name: Create Tag
3030
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
31+
env:
32+
TAG: ${{ inputs.tag }}
3133
with:
3234
github-token: ${{ steps.app-token.outputs.token }}
3335
script: |
36+
const tag = process.env.TAG;
37+
3438
github.rest.git.createRef({
3539
owner: context.repo.owner,
3640
repo: context.repo.repo,
37-
ref: 'refs/tags/${{ inputs.tag }}',
41+
ref: 'refs/tags/' + tag,
3842
sha: context.sha,
3943
});

.github/workflows/wiki.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@ jobs:
1818

1919
steps:
2020
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
21+
with:
22+
persist-credentials: 'false'
23+
2124
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
2225
with:
26+
persist-credentials: 'true'
2327
repository: ${{ github.repository }}.wiki
2428
path: wiki.git
2529

.github/zizmor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
rules:
2+
cache-poisoning:
3+
disable: true

.golangci.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@ linters:
7171
- name: error-return
7272
- name: error-strings
7373
- name: errorf
74+
- name: forbidden-call-in-wg-go
7475
- name: get-return
7576
- name: identical-branches
7677
- name: if-return
7778
- name: import-alias-naming
7879
- name: import-shadowing
7980
- name: increment-decrement
81+
- name: inefficient-map-lookup
8082
- name: indent-error-flow
8183
- name: modifies-parameter
8284
- name: modifies-value-receiver
@@ -106,6 +108,7 @@ linters:
106108
- name: time-naming
107109
- name: unconditional-recursion
108110
- name: unexported-naming
111+
- name: unnecessary-if
109112
- name: unnecessary-stmt
110113
- name: unreachable-code
111114
- name: unused-parameter

0 commit comments

Comments
 (0)