Archived post: posted sometime between 2016 and 2022.

I have started formatting code locally with csharpier for my own READ mode during local development.

Basically, this provides read-mode and edit-mode for local development!

Start by installing CSharpier: https://csharpier.com/

dotnet tool install csharpier -g

Switch to Read Mode

  1. Format code for reading: dotnet csharpier .
  2. Read the code until you decide to make a change to it.

Switch to Write Mode

  1. Reset all the formatting: git reset --hard HEAD
  2. Make the code changes.
  3. Commit the code changes: git commit -m <some message> .
  4. Switch back to Read Mode.

This helps because:

Win-win!