You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for your interest in contributing to lean-toolchain!
3
+
Thank you for your interest in contributing to lean-toolchain.
4
4
5
-
## Getting Started
5
+
## Getting started
6
6
7
7
- Fork the repository and clone your fork.
8
-
- Install Lean 4 and Rust (see README for setup instructions).
9
-
- Run `lake build` and `lake test` to ensure a clean build.
8
+
- Install Lean 4 and Rust (see `README.md`).
9
+
- From the repository root, run `lake build` and `lake test`.
10
+
- If you touch the Rust generator or templates, run `lake exe extract` and `cargo test` / `cargo clippy --all-targets -- -D warnings` inside `rust/`.
10
11
11
-
## Coding Standards
12
+
## Toolchain policy (Lean + mathlib)
12
13
13
-
- Follow the `.editorconfig` for whitespace and indentation.
14
-
- For Lean: Use descriptive names, add docstrings, and prefer constructive proofs.
15
-
- For Rust: No `unsafe` outside FFI modules; document all public APIs.
16
-
- Write clear, minimal, and total code. Avoid `sorry` unless absolutely necessary.
14
+
The Lean version is pinned in `lean-toolchain`. **mathlib** is required in `lakefile.lean` with a git reference that matches that Lean release (for example the `v4.21.0` tag line). When you bump Lean:
17
15
18
-
## Commit Messages
16
+
1. Update `lean-toolchain`.
17
+
2. Update the mathlib `require` line to the corresponding mathlib tag or revision.
18
+
3. Run `lake update` and fix any breakage before opening a PR.
19
19
20
-
- Use [Conventional Commits](https://www.conventionalcommits.org/).
20
+
## `sorry` policy
21
21
22
-
## Pull Requests
22
+
Production code under `LeanToolchain/` is expected to contain **no**`sorry` placeholders. CI runs `scripts/check_sorry.sh`, which fails on any occurrence except files explicitly listed in `scripts/sorry_allowlist.txt` (whole-file waivers only, one repo-relative path per line; use sparingly and justify in the PR).
23
23
24
-
- Ensure all tests pass (`lake test`).
25
-
- Add/Update documentation as needed.
26
-
- Link related issues in your PR description.
24
+
## Coding standards
27
25
28
-
## Code of Conduct
26
+
- Follow `.editorconfig` for whitespace and indentation.
27
+
- For Lean: descriptive names, docstrings where they aid readers, and constructive proofs.
28
+
- For generated Rust: `pub unsafe extern "C"` entrypoints are used for FFI-shaped APIs; keep `unsafe` blocks minimal and obvious.
Pushes and pull requests run a local GitHub Actions workflow (see `.github/workflows/local-ci.yml`) that builds Lean, runs tests, regenerates `rust/` with `lake exe extract`, runs `cargo test` / `cargo clippy`, and enforces the sorry policy. Additional organization checks may run via SentinelOps (`formal-verify.yml`).
53
+
54
+
For a concise overview of how those pieces fit together, see [`docs/development/ci.md`](docs/development/ci.md).
0 commit comments