RepoConventions is a .NET tool that runs convention scripts configured for a repository, committing any resulting changes and optionally opening a GitHub pull request.
Caution
This is an inherently dangerous tool. It runs PowerShell scripts from arbitrary GitHub repositories, potentially with full access to local files and production secrets, with the capability of automatically merging pull requests. Only apply conventions from trusted sources. Make sure that conventions from trusted sources don't reference conventions from untrusted sources. Convention paths that are not pinned to a specific SHA are subject to supply chain attacks, so make sure convention repositories are secure and that contributions are carefully reviewed.
Before running RepoConventions, make sure the following tools are installed:
dotnet: .NET 10 SDK or laterpwsh: PowerShell 7 or latergit: Git CLI, configured and authenticatedgh: GitHub CLI, configured and authenticated (for opening PRs)
Individual conventions may require additional tools.
Run the tool with dnx:
dnx repo-conventions --helpAlternatively, e.g. to run in a repository configured for .NET 8, which doesn't suppport dnx, install the tool globally:
dotnet tool install -g repo-conventions
repo-conventions --helpTo add a convention to the current repository:
dnx repo-conventions add Faithlife/CodingGuidelines/conventions/gitattributes-lfThat command creates .github/conventions.yml if it does not already exist:
conventions:
- path: Faithlife/CodingGuidelines/conventions/gitattributes-lfCommit the configuration file, then apply the convention:
dnx repo-conventions apply- Repository Configuration — Configure
.github/conventions.yml, declare local and remote conventions, pass settings, and configure pull request metadata. - CLI Reference — Run the
add,validate, andapplycommands, with path options, pull request options, and clean-repository requirements. - Convention Configuration — Learn the shared YAML model for convention references, settings, commit settings, and pull request settings.
- Convention Authoring — Create idempotent convention directories with
convention.yml, scripts, local documentation, tests, and child settings expressions.