aspnetcore icon indicating copy to clipboard operation
aspnetcore copied to clipboard

Add pre-commit hook with code formatting

Open nazolek opened this issue 1 year ago • 5 comments

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:

  1. Working with the files only in staged/unstaged areas.
  2. Resolving the issue with partially committed files.
  3. Setting up the hook inside both build.ps1 and build.sh - Might need help with setting the hook up correctly

Fixes #27632

nazolek avatar Nov 14 '24 21:11 nazolek

@dotnet-policy-service agree

nazolek avatar Nov 14 '24 21:11 nazolek

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?

wtgodbe avatar Nov 19 '24 18:11 wtgodbe

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?

wtgodbe avatar Dec 09 '25 23:12 wtgodbe