-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Orchard Core analyzers (OSOE-346) #15
Comments
@Piedone is there any analyzers developed yet? If not is there a repo or project that I can start prototype the localizer analyzer |
Not yet, we'd start in this project, so please fork it. |
Sure |
mark |
Here's a proposition for a valuable analyzer: Verify that an exception defined in a
|
Tutorial on writing an analyzer: https://www.meziantou.net/roslyn-analyzers-how-to.htm. |
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:
[Admin]
) or with an explicitIAuthorizationService
call.ISession
queries. While not always, usually there should be some kind of filtering instead of a full table retrieval.IContentManager.GetAsync(string id)
calls in a loop and suggestIContentManager.GetAsync(IEnumerable<string> contentItemIds, bool latest = false)
instead.IClock
instead ofDateTime.UtcNow
.IStringLocalizer<MyClass>
orIHtmlLocalizer<MyClass>
. The type parameter mustn't be omitted or have a different type than the current type. This would actually be generally interesting for ASP.NET Core MVC apps. Came up here too: Fix localizer type in tenants ApiController OrchardCMS/OrchardCore#10987Sdk
attribute beingMicrosoft.NET.Sdk.Razor
in the csproj's<Project>
element if Razor templates are being used._prefixedWithUnderscoreCamelCased
except forT
andH
. We can modify SX1309 for this. The alternative would be to put all localizers into properties instead and enable SX1309.Jira issue
The text was updated successfully, but these errors were encountered: