Skip to content

Commit 9704f93

Browse files
committed
mv getting-started info to CONTRIBUTING.md
1 parent 4481ab3 commit 9704f93

File tree

5 files changed

+88
-8
lines changed

5 files changed

+88
-8
lines changed

.github/workflows/run-dev-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
steps:
3232
- uses: actions/checkout@v4
3333

34+
- run: rustup update --no-self-update
3435
- run: rustup component add llvm-tools-preview
3536

3637
# https://docs.rs/openssl/latest/openssl/#automatic

CONTRIBUTING.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Contributing
2+
3+
This project requires the following tools installed:
4+
5+
- :simple-rust: [rust](https://rustup.rs/)
6+
- :simple-uv: [`uv` (Python Project management tool)](https://docs.astral.sh/uv/)
7+
8+
## Getting started
9+
10+
After checking out the repo locally, use
11+
12+
```sh
13+
uv sync
14+
```
15+
16+
This creates a venv at ".venv/" in repo root (if it doesn't exist).
17+
It also installs dev dependencies like `pre-commit`, `nox`, `ruff`, and `mypy`.
18+
19+
See [`uv sync` docs](https://docs.astral.sh/uv/reference/cli/#uv-sync)
20+
for more detailed usage.
21+
22+
> [!TIP]
23+
> To register the pre-commit hooks, use:
24+
>
25+
> ```shell
26+
> uv run pre-commit install
27+
> ```
28+
29+
## Running tests
30+
31+
First ensure that the following cargo-managed binaries are installed:
32+
33+
- [`cargo-llvm-cov`](https://github.com/taiki-e/cargo-llvm-cov)
34+
- [`cargo-nextest`](https://nexte.st/docs/installation/pre-built-binaries/)
35+
- [`llvm-cov-pretty`](https://crates.io/crates/llvm-cov-pretty) is used only for the optional `nox -s pretty-cov` task. Without this installed, `nox -s llvm-cov` will suffice.
36+
37+
Use nox to run tests:
38+
39+
```sh
40+
uv run nox -s test
41+
```
42+
43+
Different test profiles are still defined in .config/nextest.toml.
44+
The above command uses the "default" profile, but to mimic the CI, use:
45+
46+
```sh
47+
uv run nox -s test -- --profile ci
48+
```
49+
50+
To generate a coverage report:
51+
52+
```sh
53+
uv run nox -s llvm-cov -- --open
54+
```
55+
56+
The `-- --open` part is optional. It opens the built coverage report in your default browser.
57+
58+
The uploaded codecov report is generated with
59+
60+
```sh
61+
uv run nox -s lcov
62+
```
63+
64+
## Generating docs
65+
66+
To view the docs locally, use
67+
68+
```sh
69+
uv run nox -s docs -- --open
70+
```
71+
72+
The `-- --open` part is optional. It opens the built docs in your default browser.
73+
74+
In CI, docs are built using
75+
76+
```sh
77+
uv run nox -s docs-build
78+
```

docs/README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,11 @@ This folder is only for generating the documentation about CLI and runtime permi
44
Please [visit our website][gh-pages] to see generated documentation.
55

66
[gh-pages]: https://cpp-linter.github.io/cpp-linter-rs
7-
[uv]: https://docs.astral.sh/uv/
87

98
## Build and inspect locally
109

1110
To view the documentation locally, some software needs to be installed.
12-
This project's dependencies are managed with a tool called [`uv`][uv].
13-
So, [`uv`][uv] is the only software that needs to be manually installed beforehand.
1411

15-
After [`uv`][uv] is installed, building (and viewing) the docs is as simple as
16-
17-
```shell
18-
uvx nox -s docs -- --open
19-
```
12+
> [!IMPORTANT]
13+
> Please review of [Contributing doc](docs/getting-started.md)
14+
> which contains instruction about building and inspecting docs.

docs/docs/contributing.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<!-- markdownlint-disable MD041 -->
2+
3+
{%
4+
include "../../CONTRIBUTING.md"
5+
%}

docs/mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ nav:
1212
- python.md
1313
- node.md
1414
- changelog.md
15+
- contributing.md
1516
- other-licenses.md
1617

1718
theme:

0 commit comments

Comments
 (0)