-
Notifications
You must be signed in to change notification settings - Fork 172
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
How to format code without a solution / csproj file in the latest (6.0+) version #1317
Comments
To be clear, running manually, I get the following:
or
Here's my .pre-commit-config.yaml file:
When I run in pre-commit (from a github action -- I can't run it locally in pre-commit because of #1318), I get the following logs
|
I believe |
As Jon said, |
Thank you, that makes sense! Indeed, I only wanted the formatting, and this is perfect. |
Sorry, re-opening for one more question. The pre-commit hook always runs Should there be multiple IDs in the pre-commit hook, so that someone could select either |
Closing again; it can be overridden if needed in pre-commit-config.yaml: - repo: https://github.com/dotnet/format
rev: "2c6ded76878d585a4f037c32ba0fbb2685f27b05" # master as of 2021-09-02
hooks:
- id: dotnet-format
exclude: ^(Assets/ThirdParty)|(Packages/)
entry: dotnet-format whitespace
args:
- --folder
- --include |
@mikeage If you think additional IDs and configurations would be generally useful, we would be open to PRs that improve the pre-commit functionality. |
Thanks. I no longer think that any changes are required, but I will be opening a PR in the next few days to improve the pre-commit integration documentation. Thanks for your help |
Hi,
I recently updated from v5.0.211103 to the tip, and it seems like
--folder
is no longer supported. Whether I rundotnet format
(6.0.100-preview.7.21379.14) ordotnet-format
(7.0.245108+2c6ded76878d585a4f037c32ba0fbb2685f27b05), it doesn't recognize the --folder command, and without it, it complains about a missing workspace (I actually don't have an .sln or .csproj file at all; this is a Unity project).What is the proper syntax in the latest versions?
The text was updated successfully, but these errors were encountered: