csharpier icon indicating copy to clipboard operation
csharpier copied to clipboard

Support an option like --stdin-filepath

Open belav opened this issue 4 years ago • 2 comments

When CSharpier formats a file from stdin, it considers the current directory to be the location of the file for purposes of finding a config file and ignore file.

We should add an option --stdin-filepath This will be considered the location of the file for purposes of finding the config file and the ignore file.

belav avatar Jun 12 '21 15:06 belav

Closing for lack of interest

belav avatar Dec 26 '23 22:12 belav

This is still relevant for emacs , especially when used within apheleia.

DinoChiesa avatar Apr 22 '25 21:04 DinoChiesa

Also relevant to format files other than .cs files. Right now, trying to format a .csproj file through stdin results in errors, seemingly because csharpier can't determine the file type.

❯ dotnet csharpier format < src/API/API.csproj
Error /home/color/projects/lectio/edula/apps/api - Failed to compile so was not formatted.
  (1,1): error CS1525: Invalid expression term '<'
  (1,10): error CS1002: ; expected
...

TheColorman avatar Jul 14 '25 20:07 TheColorman

ok this is closed. I am not sure, was there a new feature implemented? How does it work? I clicked through to the other issue, there's no documentation or explanation there either.

DinoChiesa avatar Jul 26 '25 17:07 DinoChiesa

This was implemented and will be available in 1.1.0. The documentation for how it will work is at https://github.com/belav/csharpier/pull/1665/files#diff-7340b8a6d2c5b52c935f75ec72038d28b8c606323ea41bd29ced4b521eae7761

belav avatar Jul 27 '25 15:07 belav