Skip to content

Commit 8159acd

Browse files
authored
feat(ci): add docs.json bi-directional navigation structure checks (#1247)
1 parent 798d735 commit 8159acd

File tree

12 files changed

+734
-635
lines changed

12 files changed

+734
-635
lines changed

.cspell.jsonc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@
5757
"toncoins->Toncoin",
5858
"Toncoins->Toncoin",
5959
"WorkChain->workchain",
60+
"zkProof->ZK-proof",
61+
"zkProofs->ZK-proofs",
6062
],
6163
},
6264
// Do not check for banned words (denylists or flagWords) in certain files
@@ -119,6 +121,7 @@
119121
"**/*.tolk",
120122
"**/*.py*",
121123
"**/*.{ts,tsx}",
124+
"**/*.css",
122125
// Miscellaneous
123126
"**/*.git*",
124127
"**/*.svg",

.github/workflows/linter.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
echo -e '\nNo such files affected!'
5757
exit 0
5858
fi
59-
echo -e '\nChecking formatting on the following MDX and Markdown files affected by this PR:\n'
59+
echo -e '\nChecking formatting of the following MDX and Markdown files affected by this PR:\n'
6060
for file in ${ALL_CHANGED_FILES}; do
6161
echo "- $file"
6262
done
@@ -69,7 +69,7 @@ jobs:
6969
if: failure()
7070
run: |
7171
# Preparations
72-
FILES="$(echo -e "${ALL_CHANGED_FILES[@]}" | tr '\n' ' ')"
72+
FILES="$(echo -e "${ALL_CHANGED_FILES[@]}" | tr '\n' ' ' | sed 's/.*/\"&\"/')"
7373
BODY="{\"body\":\"To fix the **formatting** issues:\n\n1. Install necessary dependencies: \`npm ci\`\n2. Then, run this command:\n\`\`\`shell\nnpx remark -o --silent --silently-ignore ${FILES}\n\`\`\`\"}"
7474
# Comment on the PR
7575
curl -s -o /dev/null -L -X POST \
@@ -147,3 +147,35 @@ jobs:
147147
# - name: Check redirects against the upstream docs.json structure
148148
# if: ${{ !cancelled() }}
149149
# run: node scripts/check-redirects.mjs upstream
150+
151+
navigation-check:
152+
name: "Navigation"
153+
runs-on: ubuntu-latest
154+
steps:
155+
- name: Checkout repository
156+
uses: actions/checkout@v4
157+
with:
158+
fetch-depth: 0
159+
160+
- name: Setup Node.js
161+
uses: actions/setup-node@v4
162+
with:
163+
node-version: ${{ env.NODE_VERSION }}
164+
cache: "npm"
165+
166+
- name: Install dependencies
167+
run: |
168+
corepack enable
169+
npm ci
170+
171+
- name: Check uniqueness of navigation paths in docs.json
172+
if: ${{ !cancelled() }}
173+
run: node scripts/check-navigation.mjs unique
174+
175+
- name: Check existence of navigation .mdx pages in docs.json
176+
if: ${{ !cancelled() }}
177+
run: node scripts/check-navigation.mjs exist
178+
179+
- name: Check coverage of .mdx pages by docs.json
180+
if: ${{ !cancelled() }}
181+
run: node scripts/check-navigation.mjs cover

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ npm run spell:some <FILES...>
4343

4444
The dictionaries (or vocabularies) for custom words are placed under `resources/dictionaries`. There, each dictionary describes additional allowed or invalid entries.
4545

46-
The primary dictionary is `resources/dictionaries/custom.txt` — extend it in case a word exists but was flagged by CSpell as invalid, or in cases where the word does not exist and shall be prohibited. For the latter, use the `!` prefix when adding words.
46+
The primary dictionary is `resources/dictionaries/custom.txt` — extend it in case a word exists in American English but was flagged by CSpell as invalid, or in cases where the word does not exist and shall be prohibited. For the latter, add words to `resources/dictionaries/ban.txt` with the `!` prefix when there are no clear correct replacements.
4747

48-
If an existing two-letter word was flagged as forbidden, remove it from the `resources/dictionaries/two-letter-words-ban.txt` file.
48+
If an existing two-letter word was flagged as forbidden, remove it from the `resources/dictionaries/two-letter-words-ban.txt` file. However, if a word happened to be a part of a bigger word, e.g., `CL` in `OpenCL`, do not ban it and instead add the bigger word to the primary dictionary in `resources/dictionaries/custom.txt`.
4949

5050
See more: [CSpell docs on custom dictionaries](https://cspell.org/docs/dictionaries/custom-dictionaries).
5151

contract-dev/fee-management.mdx

Whitespace-only changes.

extra.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ span.method-nav-pill {
66
/* or 3rem */
77
}
88

9-
/* Prevent work breaks in inline code items in tables */
9+
/* Prevent word breaks in inline code items in tables */
1010
td>code,
1111
td>em>code,
1212
td>strong>code,

0 commit comments

Comments
 (0)