Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can ReSharper be configured to continuously perform solution-wide code inspection? If not, how to work around?

I desire the following from ReSharper: One window (or maybe two) that automatically displays all solution-wide errors and warnings at any time.

Unfortunately, this seems to be impossible, and there are only compromises.

  • Errors in Solution continuously shows only compiler errors and (at least some, but not all) inspections that are configured as Error.
  • Inspection Results shows all compiler errors and inspections, but only on demand (click on refresh button).
  • The editor continuously shows all compiler errors and inspections, but only for the file at hand.

Background:

We are using C# and plan to fail the CI build on violations of naming conventions etc. The CI server cannot perform pre-commit builds, so we want to make it as easy as possible for every programmer to spot problems before committing.

The current plan is to configure all inspections that we want to adhere to as Error, so at least most of them are shown in the automatically updated Errors in Solution.

However, I am not 100% comfortable with having compilers errors and less severe inspections in the same category. E.g., when I am still developing and not yet determined to commit, I do not want "Using directive not required" to show up as if it where a compiler error.

What approach can you suggest?

like image 634
Marco Eckstein Avatar asked Dec 05 '25 04:12

Marco Eckstein


1 Answers

From the first part of your question it would seem that you need ReSharper's Solution-Wide Error Analysis (SWEA), but it looks like you're already using it. Just to make sure, it's the little circle on the bottom-right corner of your Visual Studio. If you double-click it, it will ask you to turn on SWEA, and you will be notified of errors in the entire solution, live, as they happen. You can navigate between those errors and fix them without recompiling. It will be green if there are no errors in the entire solution.

SWEA

However the second part of your question suggests that you want to perform naming convention enforcing and other things as part of your CI build, in this case you'd likely want to use the ReSharper command-line tools, which were created exactly for this purpose - run as a part of the build and enforce/check certain rules.

With little work, you could integrate it with your CI server.

Hope this helps.

like image 107
Igal Tabachnik Avatar answered Dec 07 '25 18:12

Igal Tabachnik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!