Skip to content

Commit 1c52018

Browse files
committed
resolving lint and spell errors
1 parent 983809a commit 1c52018

7 files changed

Lines changed: 347 additions & 2 deletions

File tree

.github/workflows/linting.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,27 @@ on:
1111
jobs:
1212
docs-lint:
1313
name: Documentation
14-
uses: ROCm/rocm-docs-core/.github/workflows/linting.yml@develop
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- name: Set up Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: "20"
22+
23+
- name: Install markdownlint-cli2
24+
run: npm install -g markdownlint-cli2
25+
26+
- name: Set up Python and pyspelling
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: "3.11"
30+
31+
- name: Install spelling dependencies
32+
run: |
33+
sudo apt-get update && sudo apt-get install -y aspell aspell-en
34+
pip install pyspelling
35+
36+
- name: Run docs lint (markdown + spelling)
37+
run: make docs-lint

.markdownlint.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Match rocm-docs-core linting rules
2+
# Relaxed for existing docs; tighten over time if desired.
3+
default: true
4+
5+
# Line length (often too strict for prose/tables)
6+
MD013: false
7+
8+
# First heading h1, first line (conflicts with multi-section READMEs)
9+
MD041: false
10+
11+
# Inline HTML / bare URLs (allow in docs)
12+
MD033: false
13+
MD034: false
14+
15+
# Duplicate headings (only warn across siblings)
16+
MD024:
17+
siblings_only: true
18+
19+
# Heading punctuation
20+
MD026:
21+
punctuation: ".,;:!"
22+
23+
# --- Relaxed for open-source docs (high churn, many contributors) ---
24+
25+
# Multiple top-level headings (READMEs/docs often use several # sections)
26+
MD025: false
27+
28+
# Heading level increment (allow ## then #### without ###)
29+
MD001: false
30+
31+
# Blank lines around headings and code blocks (readability; skip for legacy)
32+
MD022: false
33+
MD031: false
34+
35+
# Blank lines around lists
36+
MD032: false
37+
38+
# Ordered list prefix style (1/2/3 vs 1/1/1)
39+
MD029: false
40+
41+
# Fenced code block language (syntax highlighting; optional)
42+
MD040: false
43+
44+
# Table column alignment (cosmetic)
45+
MD060: false
46+
47+
# Unordered list style (dash vs asterisk)
48+
MD004: false
49+
50+
# Multiple consecutive blank lines
51+
MD012: false
52+
53+
# Trailing spaces (noisy in legacy docs; enable later for new edits)
54+
MD009: false

.spellcheck.yaml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# BSD 3-Clause License
2+
#
3+
# Copyright (c) 2017-2022, Pytorch contributors
4+
# All rights reserved.
5+
# Modifications Copyright (c) 2023, Advanced Micro Devices, Inc.
6+
# All rights reserved.
7+
#
8+
# Redistribution and use in source and binary forms, with or without
9+
# modification, are permitted provided that the following conditions are met:
10+
#
11+
# * Redistributions of source code must retain the above copyright notice, this
12+
# list of conditions and the following disclaimer.
13+
#
14+
# * Redistributions in binary form must reproduce the above copyright notice,
15+
# this list of conditions and the following disclaimer in the documentation
16+
# and/or other materials provided with the distribution.
17+
#
18+
# * Neither the name of the copyright holder nor the names of its
19+
# contributors may be used to endorse or promote products derived from
20+
# this software without specific prior written permission.
21+
22+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32+
33+
matrix:
34+
- name: Markdown
35+
sources:
36+
- ['docs/**/*.md']
37+
expect_match: false
38+
aspell:
39+
lang: en
40+
dictionary:
41+
wordlists:
42+
- .wordlist.txt
43+
pipeline:
44+
- pyspelling.filters.context:
45+
context_visible_first: true
46+
delimiters:
47+
# Manual disabling via: #spellcheck-disable
48+
- open : '^ *<!-- *spellcheck-disable *-->$'
49+
content: '[\s\S]*?'
50+
close: '^ *<!-- *spellcheck-enable *-->$'
51+
# Ignore URLs in [text](URL)
52+
- open : '\[[^]]*?]\('
53+
content: '[^)]*?'
54+
close: '\)'
55+
# Ignore out-of-line URL references in [text][reference-name]
56+
- open : '\[[^\]]*?\]\['
57+
content: '[^\]]*?'
58+
close: '\]'
59+
# Ignore out-of-line URL definitions
60+
- open : '^ {0,3}\[[^\]]*?\]:\s*\S+'
61+
close: '$'
62+
# Ignore URLs in <URL>
63+
- open : '\<'
64+
content: '[^]]*?'
65+
close: '\>'
66+
# Ignore text in backtick code blocks.
67+
- open : '(?s)^(?P<open> *`{3,})[^\n]*$'
68+
close: '^(?P=open)$'
69+
# Ignore text between inline back ticks
70+
- open : '(?P<open>`+)'
71+
content: '[^\n]+'
72+
close: '(?P=open)'
73+
# Ignore block classes and extra in :::{class} extra
74+
- open : '^ *:{3,}'
75+
content: '[^\n]+'
76+
close: ''
77+
# Ignore keys in :property: key
78+
- open : '^ *:[^\n:]*: +'
79+
content: '[^\n]+'
80+
close: '$'
81+
# Ignore properties in :property:
82+
- open : '^ *:'
83+
close: ':'
84+
# Ignore tag in (tag)=
85+
- open : '('
86+
content: '[^\n]+'
87+
close: ')=$'
88+
- pyspelling.filters.url:
89+
- name: reST
90+
sources:
91+
- ['docs/**/*.rst']
92+
expect_match: false
93+
aspell:
94+
lang: en
95+
dictionary:
96+
wordlists:
97+
- .wordlist.txt
98+
pipeline:
99+
- pyspelling.filters.markdown:
100+
- pyspelling.filters.html:
101+
comments: false
102+
ignores:
103+
- code
104+
- pre
105+
- pyspelling.filters.url:

.wordlist.txt

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -907,3 +907,104 @@ datacenter
907907
programmability
908908
uptime
909909
TPX
910+
aG
911+
AINIC
912+
autoremove
913+
barebones
914+
baseurl
915+
cdi
916+
CDI
917+
CLIs
918+
CLK
919+
conf
920+
containerd
921+
containerd's
922+
cpus
923+
ctk
924+
dearmor
925+
dmesg
926+
dnf
927+
dri
928+
Dockerfiles
929+
dpkg
930+
EOF
931+
Enroot
932+
enroot
933+
gdrcopy
934+
GID
935+
gpg
936+
gpgcheck
937+
gpgkey
938+
Gres
939+
gpu
940+
gpus
941+
gres
942+
GPUDirect
943+
headnode
944+
html
945+
impactful
946+
integrations
947+
io
948+
jq
949+
journalctl
950+
json
951+
keyrings
952+
Kubernetes
953+
libelf
954+
libssl
955+
libudev
956+
LOGNAME
957+
loopback
958+
lsmod
959+
modprobe
960+
mycontainer
961+
myst
962+
natively
963+
nerdctl
964+
newgrp
965+
ntasks
966+
Numbat
967+
nvidia
968+
OCI
969+
nvslurm
970+
OpenIB
971+
perf
972+
PMIx
973+
png
974+
QoS
975+
Podman
976+
podman
977+
Pollara
978+
px
979+
pytorch
980+
pyxis
981+
Pyxis
982+
renderD
983+
roce
984+
RoCEv
985+
routable
986+
rsmi
987+
runtime's
988+
runtimeArgs
989+
RUNC
990+
sbatch
991+
SBATCH
992+
slurm
993+
slurmctld
994+
SLURM
995+
slurmd
996+
sqsh
997+
sudo
998+
systemctl
999+
tensorflow
1000+
Toolkit's
1001+
ubuntu
1002+
uname
1003+
unpartitioned
1004+
usecase
1005+
usermod
1006+
usr
1007+
UUIDs
1008+
warmup
1009+
wget
1010+
AutoDetect

Makefile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,39 @@ vet: ## Run go vet against code.
200200
test: ## Run go test against code.
201201
AMD_CTK_PATH=$(CURDIR)/bin/$(BIN_DIRECTORY_SUFFIX)/amd-ctk go test -v ./...
202202

203+
# Docs lint (Markdown + spelling; matches CI linting checks)
204+
DOCS_MARKDOWNLINTCONFIG ?= .markdownlint.yaml
205+
DOCS_MD_GLOB ?= "**/*.md"
206+
DOCS_SPELLCHECK_CONFIG ?= .spellcheck.yaml
207+
208+
.PHONY: docs-lint-markdown
209+
docs-lint-markdown: ## Run markdownlint on all Markdown files.
210+
markdownlint-cli2 $(DOCS_MD_GLOB) --config $(DOCS_MARKDOWNLINTCONFIG)
211+
212+
.PHONY: docs-lint-spelling
213+
docs-lint-spelling: ## Run pyspelling (spellcheck) using .spellcheck.yaml.
214+
pyspelling -c $(DOCS_SPELLCHECK_CONFIG)
215+
216+
.PHONY: docs-lint
217+
docs-lint: ## Run docs Markdown lint + spelling (full docs lint, same as CI).
218+
$(MAKE) docs-lint-markdown
219+
$(MAKE) docs-lint-spelling
220+
221+
# Run docs lint inside a container (no local Node/Python/aspell needed)
222+
DOCS_LINT_IMAGE ?= $(DOCKER_REGISTRY)/container-toolkit-docs-lint:latest
223+
.PHONY: docs-lint-docker docs-lint-docker-build docs-lint-docker-push
224+
docs-lint-docker: ## Run docs lint in Docker (markdown + spelling). Image must exist locally or use docs-lint-docker-pull.
225+
docker run --rm -v $(CURDIR):/repo -w /repo $(DOCS_LINT_IMAGE) docs-lint
226+
227+
docs-lint-docker-pull: ## Pull the docs-lint image from the registry (run once or to update).
228+
docker pull $(DOCS_LINT_IMAGE)
229+
230+
docs-lint-docker-build: ## Build the docs-lint image locally (for Dockerfile changes or first-time setup).
231+
docker build -t $(DOCS_LINT_IMAGE) -f $(CURDIR)/tools/docs-lint/Dockerfile $(CURDIR)/tools/docs-lint
232+
233+
docs-lint-docker-push: docs-lint-docker-build ## Build and push the docs-lint image to the registry (for maintainers/CI).
234+
docker push $(DOCS_LINT_IMAGE)
235+
203236
GOLANGCI_LINT = $(shell pwd)/bin/golangci-lint
204237
.PHONY: golangci-lint
205238
golangci-lint: ## Download golangci-lint locally if necessary.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Overview
22
AMD Container Toolkit offers tools to streamline the use of AMD GPUs with containers. The toolkit includes the following packages.
33
- ```amd-container-runtime``` - The AMD Container Runtime
4-
- ```amd-ctk``` - The AMD Container Toolkit CLI
4+
- ```amd-ctk``` - The AMD Container Toolkit CLI
55

66
# Requirements
77
- Ubuntu 22.04 or 24.04, or RHEL/CentOS 9

tools/docs-lint/Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Minimal image for running docs lint (markdownlint + pyspelling) locally.
2+
# Use: make docs-lint-docker (from repo root)
3+
ARG BUILD_BASE_IMAGE=ubuntu:22.04
4+
FROM ${BUILD_BASE_IMAGE}
5+
6+
ENV DEBIAN_FRONTEND=noninteractive
7+
8+
# Node.js 22.x (markdownlint-cli2 requires Node >= 20)
9+
RUN apt-get update && apt-get install -y curl ca-certificates && \
10+
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
11+
apt-get clean && rm -rf /var/lib/apt/lists/*
12+
13+
RUN apt-get update && apt-get install -y \
14+
make \
15+
python3 \
16+
python3-pip \
17+
aspell \
18+
aspell-en \
19+
nodejs \
20+
git \
21+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
22+
23+
RUN npm install markdownlint-cli2 --global
24+
RUN pip3 install pyspelling
25+
26+
WORKDIR /repo
27+
28+
ENTRYPOINT ["make"]
29+
CMD ["docs-lint"]

0 commit comments

Comments
 (0)