Skip to content
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

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

Merged
merged 6 commits into from
Aug 16, 2024
Merged

Conversation

belav
Copy link
Owner

@belav belav commented Jul 27, 2024

closes #1131

@shocklateboy92
Copy link
Collaborator

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
Copy link

rodion-m commented Aug 3, 2024

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

@belav
Copy link
Owner Author

belav commented Aug 3, 2024

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 - #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
Copy link
Owner Author

belav commented Aug 3, 2024

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.

… treated as errors by csharpier.

There didn't appear to be a good way to get msbuild happy with the different possible outcomes without adding the flag to treat compilation errors as warnings.
I tried using IgnoreStandardErrorWarningFormat and IgnoreExitCode in different combinations based on if CSharpier_Check was true or false but couldn't get every scenario working.
@belav
Copy link
Owner Author

belav commented Aug 4, 2024

@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.

shocklateboy92
shocklateboy92 previously approved these changes Aug 6, 2024
@belav belav merged commit 0df263d into main Aug 16, 2024
3 checks passed
@belav belav deleted the exit-code-for-compilation-fails branch August 16, 2024 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to abort bash script if warnings from dotnet CLI tool?
3 participants