Skip to content

Commit aa6c22f

Browse files
authored
feat: add more content for contribution docs (#175)
Signed-off-by: yuluo-yx <[email protected]>
1 parent fac50b1 commit aa6c22f

File tree

3 files changed

+80
-2
lines changed

3 files changed

+80
-2
lines changed

tools/make/linter.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# = Everything For Project Linter, markdown, yaml, code spell etc. =
33
# =============================== linter.mk ==========================
44

5-
docs-lint:
5+
docs-lint: docs-install
66
@$(LOG_TARGET)
77
cd website && npm run lint
88

9-
docs-lint-fix:
9+
docs-lint-fix: docs-install
1010
@$(LOG_TARGET)
1111
cd website && npm run lint:fix
1212

website/src/pages/community/community-page.module.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@
130130
margin-top: 0.25rem;
131131
}
132132

133+
.stepNumberTips {
134+
display: flex;
135+
flex-direction: column;
136+
margin: 0 0 0 1rem;
137+
}
138+
139+
.stepNumberTips p {
140+
line-height: 1.5;
141+
}
142+
133143
.step h4 {
134144
margin: 0 0 0.5rem 0;
135145
color: var(--ifm-color-primary);

website/src/pages/community/contributing.js

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,16 @@ export default function Contributing() {
103103
<div>
104104
<h4>Test</h4>
105105
<p>Run tests and ensure your changes don't break existing functionality.</p>
106+
<div className={styles.stepNumberTips}>
107+
<p>1. Run precommit hooks, ensure compliance with the project submission guidelines;</p>
108+
<p>
109+
2. You can refer to
110+
{' '}
111+
<a href="/docs/getting-started/installation">Install the local</a>
112+
{' '}
113+
to start semantic-router locally.
114+
</p>
115+
</div>
106116
</div>
107117
</div>
108118

@@ -117,6 +127,64 @@ export default function Contributing() {
117127
</div>
118128
</section>
119129

130+
<section className={styles.section}>
131+
<h2>⚙️ Precommit hooks</h2>
132+
<p>The Semantic-router project provides a precommit hook to standardize the entire project, including Go, Python, Rust, Markdown, and spelling error checking.</p>
133+
<p>Although these measures may increase the difficulty of contributions, they are necessary. We are currently building a portable Docker precommit environment to reduce the difficulty of contributions, allowing you to focus on functional pull requests.</p>
134+
135+
<div className={styles.card}>
136+
<h3>Manual</h3>
137+
138+
<h4>Some Tips: </h4>
139+
<div className={styles.stepNumberTips}>
140+
<p>1. If the precommit check fails, don't worry. You can also get more information by executing "make help". </p>
141+
<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>
143+
</div>
144+
145+
<div className={styles.steps}>
146+
<div className={styles.step}>
147+
<span className={styles.stepNumber}>1</span>
148+
<div>
149+
<h4>Install precommit</h4>
150+
<p>Run pip install --user precommit</p>
151+
</div>
152+
</div>
153+
<div className={styles.step}>
154+
<span className={styles.stepNumber}>2</span>
155+
<div>
156+
<h4>Install check tools</h4>
157+
<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+
</div>
163+
</div>
164+
</div>
165+
<div className={styles.step}>
166+
<span className={styles.stepNumber}>3</span>
167+
<div>
168+
<h4>Install precommit to git</h4>
169+
<p>Run pre-commit install, then pre-commit installed at .git/hooks/pre-commit</p>
170+
</div>
171+
</div>
172+
<div className={styles.step}>
173+
<span className={styles.stepNumber}>4</span>
174+
<div>
175+
<h4>Run</h4>
176+
<p>Run make precommit-check to check.</p>
177+
</div>
178+
</div>
179+
180+
<hr />
181+
182+
<h3>Docker</h3>
183+
<p>Coming soon!</p>
184+
</div>
185+
</div>
186+
</section>
187+
120188
<section className={styles.section}>
121189
<h2>🏷️ Working Group Areas</h2>
122190
<p>

0 commit comments

Comments
 (0)