Skip to content

Commit c61f2be

Browse files
authored
[ ci, lint ] Update Super-linter
1 parent 4b069af commit c61f2be

46 files changed

Lines changed: 220 additions & 114 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.editorconfig

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ root = true
33

44
# Defaults for every file
55
[*]
6+
indent_style = space
67
end_of_line = lf
78
charset = utf-8
89

@@ -13,24 +14,22 @@ max_line_length = 152
1314

1415
# Idris source files
1516
[*.{idr,ipkg,tex,yaff,lidr}]
16-
indent_style = space
1717
indent_size = 2
1818

1919
# Various configuration files
20-
[{*.yml,.ecrc}]
21-
indent_style = space
20+
[*.yml]
21+
indent_size = 2
22+
23+
[*.json]
2224
indent_size = 2
2325

2426
[*.{c,h}]
25-
indent_style = space
2627
indent_size = 4
2728

2829
[*.{md,rst}]
29-
indent_style = space
3030
indent_size = 2
3131

3232
[{*.sh,run,.rename,.convert-run-to-print-tests,tar-pack,*.bat,.patch-*}]
33-
indent_style = space
3433
indent_size = 2
3534
shell_variant = posix
3635
switch_case_indent = true
@@ -40,12 +39,12 @@ space_redirects = true
4039
indent_style = tab
4140

4241
[expected]
42+
indent_style = unset
4343
trim_trailing_whitespace = false
4444
max_line_length = off
4545

4646
[.clean-names]
4747
max_line_length = off
4848

4949
[*.py]
50-
indent_style = space
5150
indent_size = 4

.github/workflows/ci-deptycheck.yml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ name: DepTyCheck
44
on:
55
push:
66
branches:
7-
- '**'
7+
- "**"
88
tags:
9-
- '**'
9+
- "**"
1010
pull_request:
1111
branches:
1212
- main
@@ -15,9 +15,10 @@ on:
1515
workflow_dispatch:
1616
schedule:
1717
# We want to run in the beginning of the day, right after the `pack` collection is built at the end of the previous day.
18-
- cron: '0 1 * * *'
18+
- cron: "0 1 * * *"
1919

20-
permissions: read-all
20+
permissions:
21+
contents: read
2122

2223
concurrency:
2324
group: ${{ github.workflow }}@${{ github.ref }}
@@ -61,6 +62,8 @@ jobs:
6162
container: ghcr.io/stefan-hoeck/idris2-pack:latest
6263
steps:
6364
- uses: actions/checkout@v4
65+
with:
66+
persist-credentials: false # https://docs.zizmor.sh/audits/#artipacked
6467

6568
- run: pack update-db
6669
- name: Switch to appropriate `pack` collection
@@ -82,6 +85,8 @@ jobs:
8285
container: ghcr.io/stefan-hoeck/idris2-pack:latest
8386
steps:
8487
- uses: actions/checkout@v4
88+
with:
89+
persist-credentials: false # https://docs.zizmor.sh/audits/#artipacked
8590
- name: Restore state of `pack`
8691
uses: actions/download-artifact@v4
8792
with:
@@ -115,6 +120,8 @@ jobs:
115120
steps:
116121
- name: Checkout
117122
uses: actions/checkout@v4
123+
with:
124+
persist-credentials: false # https://docs.zizmor.sh/audits/#artipacked
118125
- name: Restore built thirdparties
119126
uses: actions/download-artifact@v4
120127
with:
@@ -137,6 +144,8 @@ jobs:
137144
container: ghcr.io/stefan-hoeck/idris2-pack:latest
138145
steps:
139146
- uses: actions/checkout@v4
147+
with:
148+
persist-credentials: false # https://docs.zizmor.sh/audits/#artipacked
140149
- name: Restore built thirdparties
141150
uses: actions/download-artifact@v4
142151
with:
@@ -148,7 +157,7 @@ jobs:
148157
- run: pack install deptycheck
149158

150159
- name: Tar the `pack` dir
151-
run: .github/tar-pack save-pack "${{ env.pack_dir_file }}"
160+
run: .github/tar-pack save-pack "${{ env.pack_dir_file }}"
152161
- name: Tar built TTC files
153162
run: find "$(pwd)" -name '*.tt[cm]' | .github/tar-pack save-stdin "${{ env.pack_dir_file }}"
154163
- name: Save built DepTyCheck
@@ -168,6 +177,8 @@ jobs:
168177
container: sphinxdoc/sphinx:latest
169178
steps:
170179
- uses: actions/checkout@v4
180+
with:
181+
persist-credentials: false # https://docs.zizmor.sh/audits/#artipacked
171182
- name: Install dependencies
172183
run: pip3 install -r docs/requirements.txt
173184
- run: alias sh=bash
@@ -187,6 +198,8 @@ jobs:
187198
steps:
188199
- name: Checkout
189200
uses: actions/checkout@v4
201+
with:
202+
persist-credentials: false # https://docs.zizmor.sh/audits/#artipacked
190203
- name: Get test sets
191204
id: get-test-sets
192205
run: |
@@ -213,6 +226,8 @@ jobs:
213226
steps:
214227
- name: Checkout
215228
uses: actions/checkout@v4
229+
with:
230+
persist-credentials: false # https://docs.zizmor.sh/audits/#artipacked
216231
- name: Restore built DepTyCheck
217232
uses: actions/download-artifact@v4
218233
with:
@@ -223,7 +238,10 @@ jobs:
223238
- name: Sleep a random bit
224239
run: sleep "$(shuf -i 0-10 -n 1)"
225240

226-
- run: pack test deptycheck "${{matrix.test_set}}"
241+
- name: Run tests for ${{ matrix.test_set }}
242+
run: pack test deptycheck "${TEST_SET}"
243+
env:
244+
TEST_SET: ${{ matrix.test_set }}
227245

228246
#################
229247
# Test examples #
@@ -238,6 +256,8 @@ jobs:
238256
steps:
239257
- name: Checkout
240258
uses: actions/checkout@v4
259+
with:
260+
persist-credentials: false # https://docs.zizmor.sh/audits/#artipacked
241261
- name: Get examples
242262
id: get-examples
243263
run: |
@@ -261,8 +281,12 @@ jobs:
261281
fail-fast: false # all test cases are more or less independent
262282
matrix:
263283
example: ${{ fromJSON(needs.get-examples.outputs.examples) }}
284+
env:
285+
EXAMPLE_NAME: ${{ matrix.example }}
264286
steps:
265287
- uses: actions/checkout@v4
288+
with:
289+
persist-credentials: false # https://docs.zizmor.sh/audits/#artipacked
266290
- name: Restore built DepTyCheck
267291
uses: actions/download-artifact@v4
268292
with:
@@ -273,5 +297,7 @@ jobs:
273297
- name: Sleep a random bit
274298
run: sleep "$(shuf -i 0-10 -n 1)"
275299

276-
- run: pack build "${{matrix.example}}"
277-
- run: pack test "${{matrix.example}}"
300+
- name: Build ${{ matrix.example }}
301+
run: pack build "${EXAMPLE_NAME}"
302+
- name: Test ${{ matrix.example }}
303+
run: pack test "${EXAMPLE_NAME}"

.github/workflows/ci-lame-os.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ name: Lame
44
on:
55
push:
66
branches:
7-
- '**'
7+
- "**"
88
tags:
9-
- '**'
9+
- "**"
1010
pull_request:
1111
branches:
1212
- main
@@ -32,3 +32,5 @@ jobs:
3232

3333
- name: Checkout
3434
uses: actions/checkout@v4
35+
with:
36+
persist-credentials: false # https://docs.zizmor.sh/audits/#artipacked

.github/workflows/ci-super-linter.yml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ name: Lint
44
on:
55
push:
66
branches:
7-
- '**'
7+
- "**"
88
tags:
9-
- '**'
9+
- "**"
1010
pull_request:
1111
branches:
1212
- main
@@ -15,7 +15,9 @@ on:
1515
workflow_dispatch:
1616

1717
permissions:
18+
contents: read
1819
statuses: write
20+
pull-requests: write
1921

2022
concurrency:
2123
group: ${{ github.workflow }}@${{ github.ref }}
@@ -36,10 +38,22 @@ jobs:
3638
# Full git history is needed to get a proper
3739
# list of changed files within `super-linter`
3840
fetch-depth: 0
41+
persist-credentials: false # https://docs.zizmor.sh/audits/#artipacked
3942

4043
- name: Lint Code Base
41-
uses: super-linter/super-linter/slim@v6
44+
uses: super-linter/super-linter/slim@v8
4245
env:
4346
DEFAULT_BRANCH: master
4447
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4548
IGNORE_GENERATED_FILES: true
49+
SAVE_SUPER_LINTER_SUMMARY: true # Required for generating linting reports in PR
50+
51+
VALIDATE_PYTHON_BLACK: false # Avoid conflict: Ruff is preferred
52+
VALIDATE_GIT_COMMITLINT: false
53+
54+
VALIDATE_MARKDOWN_PRETTIER: false # We use markdownlint
55+
VALIDATE_YAML_PRETTIER: false # We use yamllint
56+
57+
# Disable Biome
58+
VALIDATE_BIOME_FORMAT: false
59+
VALIDATE_BIOME_LINT: false

.linters/.codespellrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[codespell]
2+
# Skip Idris 2 source files as they contain many names
3+
# that cause false positives (e.g., `runN`, `IndexIn`, `fromT`)
4+
skip = *.idr,*/expected
5+
ignore-words-list = inferrable,ND

.linters/.jscpd.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"ignore": [
3-
"**/thirdparty/**",
4-
"**/.github/**"
5-
],
6-
"noSymlinks": "true",
7-
"exitCode": 10
2+
"threshold": 1,
3+
"noSymlinks": true,
4+
"ignore": ["**/tests/**"],
5+
"formatsExts": {
6+
"haskell": ["idr"]
7+
}
88
}

.linters/.markdown-lint.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
1-
first-line-h1: false
2-
blanks-around-fences: false
3-
MD013:
1+
---
2+
headings:
3+
style: atx
4+
ul-style:
5+
style: dash
6+
no-hard-tabs:
7+
spaces_per_tab: 2
8+
first-line-h1:
9+
allow_preamble: true
10+
line-length:
411
line_length: 152
512
code_block_line_length: 152
13+
code-block-style:
14+
style: fenced
15+
code-fence-style:
16+
style: backtick
17+
emphasis-style:
18+
style: underscore
19+
strong-style:
20+
style: asterisk

.linters/.yaml-lint.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
extends: default
3+
4+
rules:
5+
anchors:
6+
forbid-undeclared-aliases: true
7+
forbid-duplicated-anchors: true
8+
forbid-unused-anchors: true
9+
braces:
10+
forbid: non-empty
11+
min-spaces-inside-empty: 0
12+
max-spaces-inside-empty: 0
13+
brackets:
14+
min-spaces-inside: 1
15+
max-spaces-inside: 1
16+
min-spaces-inside-empty: 0
17+
max-spaces-inside-empty: 0
18+
comments:
19+
min-spaces-from-content: 1
20+
comments-indentation: disable
21+
document-end:
22+
present: false
23+
empty-lines:
24+
max: 1
25+
float-values:
26+
require-numeral-before-decimal: true
27+
hyphens:
28+
max-spaces-after: 1
29+
indentation:
30+
spaces: 2
31+
line-length:
32+
max: 152
33+
quoted-strings:
34+
quote-type: double
35+
required: false
36+
trailing-spaces: enable
37+
truthy:
38+
check-keys: false

.linters/zizmor.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
rules:
3+
unpinned-uses:
4+
# Allow referencing actions by tags instead of commit SHAs
5+
disable: true

0 commit comments

Comments
 (0)