Skip to content

Latest commit

 

History

History
95 lines (62 loc) · 3.71 KB

File metadata and controls

95 lines (62 loc) · 3.71 KB

Validators

This directory contains the Rust-based validation tools for the governance repository.

Validate Commit Message

We enforce Conventional Commits.

Check EditorConfig Compliance

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.

Validate TOML Files

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.

Validate Governance Rules

We also include several other checks to ensure integrity:

  • The key orderings in a TOML file must match the the ordering of properties in the corresponding schema file.

  • The github-username field for contributors must match the filename.

  • The slug field 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_TOKEN secret, which is unavailable for PRs from forks. As a result, it reports warnings instead of errors so that those PRs can still be merged.
  • 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.

Validate CODEOWNERS

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.

Development

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.

  1. Make sure you are in the root of the repository.

  2. Install Rust with rustup, if you do not already have it installed:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  3. Install cargo-binstall (enables use of cargo binstall):

    cargo install cargo-binstall
  4. Install Taplo:

    cargo binstall taplo-cli
  5. Check TOML files for proper formatting and/or against the schemas:

    taplo fmt --check # for formatting
    taplo check # against the schemas
  6. Run the other checks specified above:

    cargo run --bin governance