belav / csharpier

CSharpier is an opinionated code formatter for c#.
https://csharpier.com
MIT License
1.41k stars 98 forks source link

Treat files that don't compile as errors. #1311

Closed belav closed 3 months ago

belav commented 3 months ago

closes #1131

shocklateboy92 commented 3 months ago

So, I read through the linked issue and have the same feeling you do: that CSharpier used to do this before and we changed it on purpose.

Could you confirm that the behavior of CSharpier.MsBuild doesn't change as a result of this? I think there used to be an issue where CSharpier would stop be build before MsBuild go to the actual compile stage and we would only see the CSharpier errors and not the actual compiler errors.

rodion-m commented 3 months ago

Could you please merge it and update the tool? I need it to properly use it with aider.

belav commented 3 months ago

So, I read through the linked issue and have the same feeling you do: that CSharpier used to do this before and we changed it on purpose.

Could you confirm that the behavior of CSharpier.MsBuild doesn't change as a result of this? I think there used to be an issue where CSharpier would stop be build before MsBuild go to the actual compile stage and we would only see the CSharpier errors and not the actual compiler errors.

I did a bit of digging on my phone and there was this issue - https://github.com/belav/csharpier/issues/957 - and the fix appears to be ignoring the output of csharpier when run via msbuild. I'll confirm that to be sure. Good call out!

belav commented 3 months ago

Could you please merge it and update the tool? I need it to properly use it with aider.

I'm not sure what aider is but I'm hoping to have a new release out within a week or two.

belav commented 3 months ago

@shocklateboy92 you were correct that msbuild would be unhappy with this. Based on everything I just did I think #957 was about suppressing the warning output. The compilation failures would show up as a warning followed by an error without those changes. Getting msbuild happy with this change required adding a flag. I couldn't find another way to do it.