Skip to content

fix(gitattributes): enforce LF line endings for .githooks/

2db003e
Select commit
Loading
Failed to load commit list.
Open

Add optional pre-commit hook for code formatting #5178

fix(gitattributes): enforce LF line endings for .githooks/
2db003e
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden completed May 6, 2026 in 36s

1 issue

Low

Exclude glob `./**/*OptionsSetup.cs` does not recurse without `shopt -s globstar` - `.githooks/pre-commit:24`

Bash does not enable recursive ** globbing by default; shopt -s globstar is required. As written, ./**/*OptionsSetup.cs is treated as ./*/*OptionsSetup.cs and only matches files exactly one directory below the repo root. OptionsSetup.cs files in deeper paths (e.g. ./src/Sentry/Foo/BarOptionsSetup.cs) will NOT be excluded and will be reformatted by the hook, contradicting the documented intent to exclude them. Additionally, if no files match the pattern, bash passes the literal unexpanded string to dotnet format, which may also misbehave.

4 skills analyzed
Skill Findings Duration Cost
code-review 0 12.6s $0.35
find-bugs 1 33.5s $0.77
gha-security-review 0 19.0s $0.37
security-review 0 24.1s $0.41

Duration: 1m 29s · Tokens: 348.5k in / 2.9k out · Cost: $1.90