Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I wish there was good C# one (and ideally a standard one like go). When switching between typescript with prettier and C# the first thing I notice is the lack of autoformating.

edit: seems https://github.com/dotnet/format is the closest thing



I wish their was a standard c# formatter too. dotnet-format doesn't support wrapping long lines which is one of the more important features in my opinion.

Resharper has a free command line tool that supports wrapping long lines. https://www.jetbrains.com/help/resharper/CleanupCode.html

I made a wrapper for it to try and make it easier to use. https://github.com/sethreno/ReGitLint#regitlint


Thanks I will check it out


ReSharper's formatter is pretty good, but you do have to pay to use it in the VS IDE and it's kind of slow. The service I'm working on at present is fairly small (20k LOC) and formatting the entire solution takes about 5 minutes in the IDE or 30 minutes in CI. :/


Is your service open source? I'd be interested in testing it. Also, you could speed up formatting in CI by only formatting files that changed.


Nah, this is from my day job so it's a proprietary closed source thing. Supposedly the CI speed issues are because the CI has to start with cold caches every run (we use Gitlab pipelines that run in docker containers) whereas the IDE has the caches on hand. Something about the way our devops has set up the Gitlab runners makes enabling shared cache much hard than it should be so I haven't had the chance to test that. I don't think I ever tried limiting it to only changed files, that's worth a shot.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: