belav / csharpier

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

Fix inconsistent line endings in tests #1288

Closed jamesfoster closed 5 months ago

shocklateboy92 commented 5 months ago

@jamesfoster what exactly is this for? Could you clarify a little what you mean by "inconsistent line endings"?

jamesfoster commented 5 months ago

https://github.com/belav/csharpier/issues/1240#issuecomment-2122589506

I explain in this comment

After a clean checkout of the repo on windows, several tests fail because of line ending mismatches.

jamesfoster commented 5 months ago

Also notice these checks are failing. I turned on csharpier formatting on save but clearly missed a file somewhere. I'll reformat and update the branch with main later today

jamesfoster commented 5 months ago

Apologies for the delay. I had a hectic weekend. Will get to this today.

jamesfoster commented 5 months ago

Rebased onto main belav/csharpier@bc331cdd079c5963a398dc728b54b15264dbfd7f

jamesfoster commented 5 months ago

@shocklateboy92 @belav There is still one test that fails for me locally.

https://github.com/belav/csharpier/blob/bc331cdd079c5963a398dc728b54b15264dbfd7f/Src/CSharpier.Cli.Tests/CliTests.cs#L118-L131

The exit code is 0 for me but the test asserts it should be 1. Any ideas?

jamesfoster commented 5 months ago

@belav https://github.com/belav/csharpier/pull/1288#issuecomment-2173777372 Can I get your thoughts on why Should_Return_Error_When_No_DirectoryOrFile_And_Not_Piping_StdIn might be failing for me?

shocklateboy92 commented 5 months ago

Hey @jamesfoster, sorry I rudely completed the PR to get it off my queue :stuck_out_tongue:

As for your issue, you can run the test locally with a debugger breakpoint and see if it reaches this validator: https://github.com/belav/csharpier/blob/75a582ba575ff46ab76abb801d8be411df574767/Src/CSharpier.Cli/CommandLineOptions.cs#L101

jamesfoster commented 5 months ago

Thanks @shocklateboy92 I'll look into it

pisolofin commented 3 months ago

I have the same issue. In Debug of Test I can reach only, after The breakpoint will not currently be hit. No symbols have been loaded for this document. https://github.com/belav/csharpier/blob/75a582ba575ff46ab76abb801d8be411df574767/Src/CSharpier.Cli.Tests/CliTests.cs#L561

The result is: image

Can @jamesfoster halp me?

Thanks.