Lombiq / .NET-Analyzers

.NET code analyzers and code convention settings for Lombiq projects.
BSD 3-Clause "New" or "Revised" License
10 stars 7 forks source link

Custom Orchard Core analyzers (OSOE-346) #15

Open Piedone opened 3 years ago

Piedone commented 3 years ago

Let's develop custom analyzers. This is not that easy, and we'd need to publish them on NuGet since analyzers can't be used directly from the source.

Some ideas:

Jira issue

hishamco commented 2 years ago

@Piedone is there any analyzers developed yet? If not is there a repo or project that I can start prototype the localizer analyzer

Piedone commented 2 years ago

Not yet, we'd start in this project, so please fork it.

hishamco commented 2 years ago

Sure

six006 commented 2 years ago

mark

0liver commented 1 year ago

Here's a proposition for a valuable analyzer:

Verify that an exception defined in a catch clause is used at the correct position in _logger.LogError():

  1. _logger.LogError("message", ex) should trigger a violation
  2. A fix should be provided to move ex to the beginning: _logger.LogError(ex, "message").
Piedone commented 1 month ago

Tutorial on writing an analyzer: https://www.meziantou.net/roslyn-analyzers-how-to.htm.