-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add pre-commit hook for dotnet-format #4362
Conversation
DevProject/.editorconfig
Outdated
@@ -0,0 +1 @@ | |||
com.unity.ml-agents/.editorconfig |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a symlink to the "main" config.
for f in args.files: | ||
fp.write(f + "\n") | ||
|
||
subprocess_args = ["dotnet", "format", "--folder", "--include", f"@{resp_file}"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could potentially add more flags here (and in the ArgumentParser accordingly) but this works well enough for now.
Thanks to @tomekpaszek for introducing me to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Proposed change(s)
WIP - hook to run dotnet-format on cs files. Assumes the package is already installed.
Will likely fail to start precommit in CI; will definitely fail because files aren't formatted correctly.
Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)
Types of change(s)
Checklist
Other comments