Skip to content

Latest commit

 

History

History
80 lines (52 loc) · 1.51 KB

File metadata and controls

80 lines (52 loc) · 1.51 KB

Contributing

Thanks for your interest in contributing! This repository enforces a consistent C# code style via .editorconfig, a pre-commit hook (opt-in), and CI checks.

Prerequisites

  • Git
  • .NET SDK 10.x
  • Bash (macOS/Linux: built-in; Windows: Git for Windows ships Git Bash)

Enable the pre-commit hook (recommended)

Git hooks are not transferred by default when you clone a repository. This repo keeps hooks in .githooks/ and uses core.hooksPath so they can be versioned.

Run one of the setup scripts from the repo root:

./scripts/setup-githooks.ps1
bash scripts/setup-githooks.sh

This sets:

  • git config core.hooksPath .githooks

After that, every git commit will run the formatting verification.

Bypass (when you really need to)

  • One-off bypass:
git commit --no-verify
  • Disable the formatting hook for a command/session:
SKIP_DOTNET_FORMAT=1 git commit

Formatting: verify vs fix

The hook (and CI) run formatting in verify mode:

  • dotnet format whitespace ... --verify-no-changes
  • dotnet format style ... --severity warn --verify-no-changes

To run the same checks manually:

./scripts/verify-format.ps1
bash scripts/verify-format.sh --verify

To apply fixes locally:

./scripts/verify-format.ps1 -Fix
bash scripts/verify-format.sh --fix

Tests

Please ensure tests pass before submitting a PR.

dotnet test ./test/Bitbucket.Net.Tests/Bitbucket.Net.Tests.csproj