This directory contains the Rust-based validation tools for the governance repository.
We enforce Conventional Commits.
We use EditorConfig to ensure consistent coding styles.
The VSCode extension editorconfig.editorconfig
will format files automatically when saving. You can also run the check locally by
installing editorconfig-checker
and running editorconfig-checker.
We use Taplo to validate the TOML files against
the schemas defined in the __meta/schemas/ directory. The VSCode extension
tamasfe.even-better-toml
will show red squiggles in the editor for errors. You can also run the check locally by
installing taplo-cli
and running taplo fmt --check and taplo check.
We also include several other checks to ensure integrity:
-
The key orderings in a TOML file must match the the ordering of
propertiesin the corresponding schema file. -
The
github-usernamefield for contributors must match the filename. -
The
slugfield for teams must match the filename. -
All maintainers in a team must also be listed as contributors.
-
Cross-references must be valid (team contributors must exist in the
contributors/directory). -
GitHub users and repositories must exist.
-
Slack member IDs and channel IDs must be valid.
- This check requires the
SLACK_TOKENsecret, which is unavailable for PRs from forks. As a result, it reports warnings instead of errors so that those PRs can still be merged.
- This check requires the
-
Pull requests adding a new contributor must be submitted by the contributor themselves. This self-nomination approach promotes ownership, helps maintain the integrity of our contributor list, and encourages active participation with our governance process and the organization. PRs in violation will be automatically rejected.
-
When adding a new team, the team members must have already been added in previous PRs due to the earlier requirement on adding contributors. For similar reasons, you must be a maintainer of any team you create.
We use the mszostok/codeowners-validator
tool to validate the autogenerated CODEOWNERS file. This check requires the
SYNC_GITHUB_TOKEN secret, which is unavailable for PRs from forks.
As a result, this check is skipped for PRs from forks.
Validation runs automatically through GitHub Actions on PRs and pushes to main, so the following instructions will not be relevant to most people. If you are interested, you can also test validators locally, but some checks will produce warnings due to the lack of environment variables.
-
Make sure you are in the root of the repository.
-
Install Rust with
rustup, if you do not already have it installed:curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
-
Install
cargo-binstall(enables use ofcargo binstall):cargo install cargo-binstall
-
Install Taplo:
cargo binstall taplo-cli
-
Check TOML files for proper formatting and/or against the schemas:
taplo fmt --check # for formatting taplo check # against the schemas
-
Run the other checks specified above:
cargo run --bin governance