Skip to content

Commit c9711e7

Browse files
authored
infra: update tools (#501)
Signed-off-by: yuluo-yx <[email protected]>
1 parent 49bad47 commit c9711e7

File tree

3 files changed

+63
-10
lines changed

3 files changed

+63
-10
lines changed

tools/make/docs.mk

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,12 @@ docs-serve: docs-build ## Serve built documentation website
2323
docs-clean: ## Clean documentation build artifacts
2424
@$(LOG_TARGET)
2525
cd website && npm run clear
26+
27+
docs-lint: ## Lint documentation website source files
28+
@$(LOG_TARGET)
29+
cd website && npm run lint
30+
31+
docs-lint-fix: ## Fix lint issues in documentation website source files
32+
@$(LOG_TARGET)
33+
cd website && npm run lint:fix
34+

tools/make/pre-commit.mk

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
PRECOMMIT_CONTAINER := ghcr.io/vllm-project/semantic-router/precommit:latest
44

55
precommit-install: ## Install pre-commit Python package
6+
precommit-install:
67
pip install pre-commit
78

89
precommit-check: ## Run pre-commit checks on all relevant files
10+
precommit-check:
911
@FILES=$$(find . -type f \( -name "*.go" -o -name "*.rs" -o -name "*.py" -o -name "*.js" -o -name "*.md" -o -name "*.yaml" -o -name "*.yml" \) \
1012
! -path "./target/*" \
1113
! -path "./candle-binding/target/*" \
@@ -33,6 +35,7 @@ precommit-check: ## Run pre-commit checks on all relevant files
3335
# bash
3436
# and then, run `pre-commit install && pre-commit run --all-files` command
3537
precommit-local: ## Run pre-commit hooks in a Docker/Podman container
38+
precommit-local:
3639
@if command -v docker > /dev/null 2>&1; then \
3740
CONTAINER_CMD=docker; \
3841
elif command -v podman > /dev/null 2>&1; then \

website/src/pages/community/contributing.tsx

Lines changed: 51 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -139,60 +139,101 @@ const Contributing: React.FC = () => {
139139
<div className={styles.stepNumberTips}>
140140
<p>1. If the precommit check fails, don't worry. You can also get more information by executing "make help". </p>
141141
<p>2. For the pip installation tool, we recommend that you use venv for installation.</p>
142-
<p>3. You can also directly submit the PR and let GitHub CI test it for you, but this will take a lot of time!</p>
142+
<p>3. We recommend installing pre-commit through Python's virtual environment.</p>
143+
<p>4. You can also directly submit the PR and let GitHub CI test it for you, but this will take a lot of time!</p>
143144
</div>
144145

145146
<div className={styles.steps}>
146147
<div className={styles.step}>
147148
<span className={styles.stepNumber}>1</span>
148149
<div>
149150
<h4>Install precommit</h4>
150-
<p>Run pip install --user precommit</p>
151+
<p>
152+
Run
153+
<code>pip install --user pre-commit</code>
154+
</p>
151155
</div>
152156
</div>
153157
<div className={styles.step}>
154158
<span className={styles.stepNumber}>2</span>
155159
<div>
156160
<h4>Install check tools</h4>
157161
<div className={styles.stepNumberTips}>
158-
<p>Markdown: npm install -g markdownlint-cli</p>
159-
<p>Yaml: pip install --user yamllint</p>
160-
<p>CodeSpell: pip install --user codespell</p>
161-
<p>JavaScript: cd website && npm lint</p>
162+
<p>
163+
1. Markdown:
164+
<code>npm install -g markdownlint-cli</code>
165+
</p>
166+
<p>
167+
2. Yaml:
168+
<code>pip install --user yamllint</code>
169+
</p>
170+
<p>
171+
3. CodeSpell:
172+
<code>pip install --user codespell</code>
173+
</p>
174+
<p>
175+
4. JavaScript:
176+
<code>cd website && npm lint</code>
177+
</p>
178+
<p>
179+
5. Shell: take Mac as an example, execute
180+
<code>brew install shellcheck</code>
181+
</p>
162182
</div>
163183
</div>
164184
</div>
165185
<div className={styles.step}>
166186
<span className={styles.stepNumber}>3</span>
167187
<div>
168188
<h4>Install precommit to git</h4>
169-
<p>Run pre-commit install, then pre-commit installed at .git/hooks/pre-commit</p>
189+
<p>
190+
Run
191+
<code>pre-commit install</code>
192+
, then pre-commit installed at
193+
<code>.git/hooks/pre-commit</code>
194+
</p>
170195
</div>
171196
</div>
172197
<div className={styles.step}>
173198
<span className={styles.stepNumber}>4</span>
174199
<div>
175200
<h4>Run</h4>
176-
<p>Run make precommit-check to check.</p>
201+
<p>
202+
Run
203+
<code>make precommit-check</code>
204+
{' '}
205+
to check.
206+
</p>
177207
</div>
178208
</div>
179209

180210
<hr />
181211

182212
<h3>Docker/Podman</h3>
183213
<p>From the above local running method, it can be seen that the process is very troublesome and complicated. Therefore, we have provided running methods based on Docker or Podman. There is no need to install various dependent software; all you need is a container runtime.</p>
214+
215+
<h4>Some Tips: </h4>
216+
<div className={styles.stepNumberTips}>
217+
<p>
218+
Although Docker can help avoid installing too many detection tools locally, this does not mean that it will be automatically executed during the commit process. Therefore, when committing, you can use
219+
<code>git commit -s -m -n</code>
220+
{' '}
221+
to skip the detection.
222+
{' '}
223+
</p>
224+
</div>
184225
<div className={styles.step}>
185226
<span className={styles.stepNumber}>1</span>
186227
<div>
187228
<h4>Make sure Docker/Podman is installed</h4>
188-
<p>docker --version</p>
229+
<p><code>docker --version</code></p>
189230
</div>
190231
</div>
191232
<div className={styles.step}>
192233
<span className={styles.stepNumber}>2</span>
193234
<div>
194235
<h4>Run precommit by Docker/Podman</h4>
195-
<p>make precommit-local</p>
236+
<p><code>make precommit-local</code></p>
196237
</div>
197238
</div>
198239
<div>

0 commit comments

Comments
 (0)