-
-
Notifications
You must be signed in to change notification settings - Fork 101
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 package with build tasks to format on build #200
Conversation
As someone who is guilty of forgetting to prettier my files all the time at work without a file watcher, I love it. Personally, I'd want to run this for debug, and then run it with --check during release. Although doing the --check as a build step might be a little weird because it makes it harder for someone to run release code locally. My original thought was we should add some properties to support situations like that. <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<CSharpier_Disable>true</CSharpier_Disable>// maybe CSharpier_Enable?
<CSharpier_Check>true</CSharpier_Check>
</PropertyGroup> On the other hand you can always run the check as a separate github action, like I believe this depends on #181 to support .csharpierrc and .csharpierignore, which I was going to work on in the next day or two. |
I think this is what is needed to publish the msbuild project. I haven't tested out trying to reference this nuget package in a project yet. |
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Import Project="../../CSharpier.Targets"/> | ||
<PropertyGroup> | ||
<TargetFramework>net5.0</TargetFramework> |
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.
You need the netstandard2.0
here. Otherwise it can't be used to format projects that don't also target net5.0
themselves
closes #218 |
My coworkers are (pretty much) guaranteed forget to run the dotnet tool command, so I want to run it for them automatically during build.
This creates a nuget package that injects a build task that formats before build. Assuming you're fine with the approach, you'll need to update the metadata of the package and update the github actions to publish it too.