Add pre-commit hook with code formatting
Add pre-commit hook with code formatter under the hood
In the context of PR, trying to solve an issue related to file formatting during pre-commit hook.
Description
The issue #30145 outlines the backward of the previous approach and why it was reverted. Based on that, wanna suggest some improvements:
- Working with the files only in staged/unstaged areas.
- Resolving the issue with partially committed files.
- Setting up the hook inside both build.ps1 and build.sh - Might need help with setting the hook up correctly
Fixes #27632
@dotnet-policy-service agree
Thanks for your PR, @nazolek. Someone from the team will get assigned to your PR shortly and we'll get it reviewed.
Thanks for the change! Looks like the original blocking issue has been fixed, and this does solve the build.sh problem - @SteveSandersonMS, any concerns with this approach?
Looks like this PR hasn't been active for some time and the codebase could have been changed in the meantime.
To make sure no conflicting changes have occurred, please rerun validation before merging. You can do this by leaving an /azp run comment here (requires commit rights), or by simply closing and reopening.
Hi @nazolek, is this still relevant? This would only work if the user ran build.sh/ps1, right?