Skip to content

Commit 7e027e6

Browse files
committed
chore: sync tooling and helper improvements from HoldFast
Backport mod-agnostic infrastructure that diverged in the HoldFast downstream mod: - Add Markdown quality tooling: dprint formatting + Vale prose linting (dprint.json, .vale.*, lint.yml markdown job, lefthook hooks) - nexus-page generator: handle fenced code blocks and pipe tables, tighten the URL regex - banner.py: drop the numpy dependency (Pillow-only vignette) and warn on title overflow - CMakeLists: replace cached DEPLOY_DIR with DEPLOY_DIR_OVERRIDE that recomputes every configure so env changes take effect - CI: pin windows-2022, run paths-filter on all events, drop unused actions: write permission - lefthook: also clang-format test/ sources - nexus-upload: bump upload-action to beta.7, handle dispatch ref, enable mod-manager download flags Also expand the starter src/Utils.h with generic, tested helpers (TrimWhitespace, AsciiToLower, CaseInsensitiveEqual, ClampOrDefault) and matching Catch2 tests.
1 parent b8365a6 commit 7e027e6

19 files changed

Lines changed: 348 additions & 37 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
permissions:
19+
contents: read
1920
pull-requests: read
2021

2122
outputs:
@@ -27,9 +28,10 @@ jobs:
2728
ci: ${{ steps.filter.outputs.ci }}
2829

2930
steps:
31+
- uses: actions/checkout@v6
32+
3033
- uses: dorny/paths-filter@v4
3134
id: filter
32-
if: github.event_name == 'pull_request'
3335
with:
3436
filters: |
3537
src:
@@ -77,7 +79,7 @@ jobs:
7779

7880
test:
7981
needs: [changes, clang-format]
80-
runs-on: windows-latest
82+
runs-on: windows-2022
8183

8284
if: >-
8385
always() &&
@@ -92,7 +94,6 @@ jobs:
9294
9395
permissions:
9496
contents: read
95-
actions: write
9697

9798
steps:
9899
- name: Checkout
@@ -130,7 +131,7 @@ jobs:
130131

131132
build:
132133
needs: [changes, clang-format]
133-
runs-on: windows-latest
134+
runs-on: windows-2022
134135

135136
if: >-
136137
always() &&
@@ -144,7 +145,6 @@ jobs:
144145
145146
permissions:
146147
contents: read
147-
actions: write
148148

149149
steps:
150150
- name: Checkout
@@ -187,7 +187,7 @@ jobs:
187187
188188
clang-tidy:
189189
needs: [changes, clang-format, build, test]
190-
runs-on: windows-latest
190+
runs-on: windows-2022
191191

192192
if: >-
193193
always() &&
@@ -204,7 +204,6 @@ jobs:
204204
205205
permissions:
206206
contents: read
207-
actions: write
208207

209208
env:
210209
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"

.github/workflows/lint.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ on:
44
pull_request:
55
paths:
66
- 'scripts/**'
7+
- 'README.md'
8+
- 'docs/**/*.md'
9+
- '.vale.ini'
10+
- '.vale/styles/**'
11+
- 'dprint.json'
12+
- 'lefthook.yml'
13+
- '.github/workflows/lint.yml'
14+
workflow_dispatch:
715

816
permissions: {}
917

@@ -23,3 +31,28 @@ jobs:
2331
uses: azohra/shell-linter@v0.8.0
2432
with:
2533
path: "scripts/*.sh"
34+
35+
markdown:
36+
runs-on: ubuntu-latest
37+
38+
permissions:
39+
contents: read
40+
checks: write
41+
pull-requests: write
42+
43+
steps:
44+
- uses: actions/checkout@v6
45+
46+
- name: Check markdown formatting
47+
uses: dprint/check@v2.3
48+
with:
49+
args: README.md docs/**/*.md
50+
51+
- name: Annotate markdown prose
52+
uses: vale-cli/vale-action@v2
53+
with:
54+
files: "."
55+
vale_flags: "--glob=README.md --glob=docs/**/*.md"
56+
reporter: github-pr-check
57+
filter_mode: nofilter
58+
fail_on_error: true

.github/workflows/nexus-upload.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
uses: actions/checkout@v6
4040
with:
4141
fetch-depth: 0
42-
ref: v${{ steps.version.outputs.value }}
42+
ref: ${{ github.event_name == 'release' && format('v{0}', steps.version.outputs.value) || '' }}
4343

4444
- name: Compute cliff range
4545
id: range
@@ -105,7 +105,7 @@ jobs:
105105
printf '%s\n' "$DELIM" >> "$GITHUB_OUTPUT"
106106
107107
- name: Upload to Nexus Mods
108-
uses: Nexus-Mods/upload-action@v1.0.0-beta.5
108+
uses: Nexus-Mods/upload-action@v1.0.0-beta.7
109109
with:
110110
api_key: ${{ secrets.NEXUSMODS_API_KEY }}
111111
file_group_id: ${{ vars.NEXUSMODS_FILE_GROUP_ID }}
@@ -114,3 +114,6 @@ jobs:
114114
description: ${{ steps.notes.outputs.notes }}
115115
version: ${{ steps.version.outputs.value }}
116116
archive_existing_file: true
117+
primary_mod_manager_download: true
118+
allow_mod_manager_download: true
119+
show_requirements_pop_up: true

.github/workflows/release.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ permissions: {}
99

1010
jobs:
1111
release:
12-
runs-on: windows-latest
12+
runs-on: windows-2022
1313

1414
permissions:
1515
contents: write
16-
actions: write
1716

1817
steps:
1918
- name: Checkout

.vale.ini

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
StylesPath = .vale/styles
2+
MinAlertLevel = warning
3+
Vocab = Project
4+
IgnoredScopes = code, tt
5+
6+
[*.md]
7+
BasedOnStyles = Project
8+
TokenIgnores = (\bhttps?://\S+\b), (\[/?url(?:=[^\]]+)?\]), (\b[A-Za-z0-9_.-]+\.(?:dll|ini|exe|zip|7z|md|yml|yaml|json)\b), (\b[A-Za-z0-9_.-]+/[A-Za-z0-9_./-]+\b)

.vale/styles/Project/Acronyms.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: substitution
2+
message: "Use '%s' instead of '%s'."
3+
level: warning
4+
ignorecase: false
5+
swap:
6+
pr: PR
7+
ci: CI
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
extends: existence
2+
message: "Avoid vague wording like '%s'."
3+
level: warning
4+
ignorecase: true
5+
tokens:
6+
- just
7+
- simply
8+
- obviously
9+
- easy
10+
- easily
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: substitution
2+
message: "Use '%s' instead of '%s'."
3+
level: warning
4+
ignorecase: false
5+
swap:
6+
github actions: GitHub Actions
7+
skyrim special edition: Skyrim Special Edition

.vale/styles/Project/LinkText.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
extends: existence
2+
message: "Use descriptive link text instead of '%s'."
3+
level: warning
4+
ignorecase: true
5+
tokens:
6+
- click here
7+
- this link
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ExampleMod
2+
SKSE
3+
SKSE64
4+
CommonLibSSE-NG
5+
Lefthook
6+
NexusMods
7+
GitHub
8+
vcpkg
9+
CMake
10+
clangd
11+
clang-format
12+
clang-tidy
13+
dprint
14+
Vale
15+
xwin

0 commit comments

Comments
 (0)