-
Notifications
You must be signed in to change notification settings - Fork 47
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
Support NuGet based code analyzers #625
Conversation
Will also add docs update if we agree to merge this. |
@jmezach Thoughts on: Wonder if we should remove support for our current way to add analyzers? - I am tempted to. |
What do you mean exactly with our current way of adding analyzers? |
@jmezach I mean this part of the docs: You can also bring your own rules. For an example of custom rules, see this repository. To use custom rules, place the rule .dll files in a Rules folder in the project, and add them as Content items: <ItemGroup>
<Content Include="Rules\My.Own.Rules.dll" />
</ItemGroup>
|
Yeah, I think that makes sense. We might want to explain how folks could create a NuGet package with their custom rules though. |
Yes, working on the docs now! |
Remove file based "bring your own rules" support
@jmezach I have gotten concerned that we are now reducing the number of active rules from 70+ to 15 for a user coming from a previous version of the SDK. Could we add a warning if no Analyzers are referenced during analysis? And give the warning a code, so it can be overriden? |
Yeah, I think that would make sense to do. |
LGTM :) |
@jmezach PR updated with the warning and some more logging info |
@jmezach any thing else you would like me to address? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just left a few small corrections on the README
Co-authored-by: Jeff Rosenberg <rosenberg.jeff@gmail.com>
Co-authored-by: Jeff Rosenberg <rosenberg.jeff@gmail.com>
Co-authored-by: Jeff Rosenberg <rosenberg.jeff@gmail.com>
@jeffrosenberg Thanks! |
@jmezach Wonder if I should update the docs in general with this?
|
My apologies, I've been out sick for a couple of days, hence the radio silence. @ErikEJ If targeting netstandard2.1 is a requirement for being able to reference the rules packages, then yes, maybe we should update the docs. It doesn't have a big impact anyway. We should probably also update the templates for that. |
@jmezach Glad that you are well again! I have updated the readme, the templates were already updated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall, just a couple of tweaks I think
@jmezach If we default to having Code Analysis always on, I assume we need to update the readme as well? |
@jmezach But maybe I misunderstood your review comment? |
Thanks @jmezach and @jeffrosenberg I will also update my blog post here, when 2.9.0 is released: https://erikej.github.io/dacfx/codeanalysis/sqlserver/2024/04/02/dacfx-codeanalysis.html |
@jmezach Can you assist with a release of 2.9.0 🙏 - TIA |
Release pipeline should be running now |
2.9.0 is up on NuGet |
Do you want to write release notes for this? |
I can do that yes |
fixes #569
This supports the "official" way to pack SQL analyzers.
For an example of an analyzer .csproj see this
Wonder if we should remove support for our current way to add analyzers? - I am tempted to.
Notice that the Test project has been updated to target
netstandard2.1
in order for restore of the rule dll to work.