Skip to main content

Continuous Integration

Normally when using a code formatter like CSharpier, you'll want to ensure that all code that makes it to your main branch has been formatted. This can be accomplished by doing the following

  1. Set up a dotnet tool manifest file at .config/dotnet-tools.json with the following content. Replacing [SpecificVersion] with the version of CSharpier you are currently using.
    "version": 1,
    "isRoot": true,
    "tools": {
    "csharpier": {
    "version": "[SpecificVersion]",
    "commands": [
  2. Use your preferred CI/CD tool to run the following commands.
    dotnet tool restore
    dotnet csharpier --check .
    An example Github Actions workflow to accomplish this
    name: Validate PR
    branches: [ main ]
    runs-on: ubuntu-latest
    name: Check Formatting
    - uses: actions/checkout@v2
    - run: |
    dotnet tool restore
    dotnet csharpier --check .