While using Rider recently, I found that the code that I had written had unnecessary whitespace. Here’s how I got Rider to notify me when there’s unnecessary whitespace:

  1. Go to settings (In Windows/Linux: File => Settings; Mac: Jetbrains Rider Menu => Settings).
  2. In the left pane, click on the arrow next to Editor. Then click on Inspection Settings => Inspection Severity => C#.
  3. In the right pane, Expand Syntax Style. Click to enable “Unnecessary whitespace at the end of the line”.
  4. To the right of “Unnecessary whitespace at the end of the line” choose the notification level: Hint, Suggestion, Warning, or Error.
  5. Once you have chosen that, click on Save. If you click on the arrow next to Save, you can choose to save the settings to the solution you have open or to your computer.

“Rider whitspace notification setting”