-
Notifications
You must be signed in to change notification settings - Fork 110
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
[Suggestion] Ignore DS137138 in xml documentation and xml namespaces #14
Comments
An improvement we should broadly make is the ability to say "this rule doesn't apply to this code type". Right now we support "applies_to" which says what languages it applies to, and if left empty it applies to everything. The flaw in that is that if we want to allow everything BUT one or two code types, then we need to call out the dozen languages it should apply to, rather than the two it shouldn't. It isn't a hard change, so we should probably add that to the schema @PavelBansky & @scovetta |
Do we have some existing example where this will be needed, or is it just an idea? |
VS projects drop a
DevSkim triggers on that second like (http://schemas...). |
I hit on this as well. The rule triggers on .csproj files that don't use the new SDK attribute (
As well as csproj, if you want to add MSBuild files using the props (as @scovetta mentions) or targets convention you also get a hit with this rule. For example: A valid props file that triggers the rule
A valid targets file that triggers the rule
Obviously these all come from the same root; the xml namespace |
@joshbw Does the VSCode engine support negative lookbehinds in the regex? If so, we might be able to handle this specific instance with |
|
Another one for the pile: NamespaceAttribute. Running on a codebase with a generated SOAP proxy results in hundreds of violations. Seeing stuff like:
or
This example is from code generated by an older tool but it is still not something a developer can really change (especially as a client) and throws up a ton of noise when trying to review code |
Thanks @Lexcess for the samples -- we'll make sure we cover these! |
Affects WIX: <Wix
xmlns="http://schemas.microsoft.com/wix/2006/wi"
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> |
@scovetta JavaScript doesn't have LookBehind (though it has LookAhead), so it's non-trivial to support. I think our "BeforeFinding" support function would be easier to implement |
I have a similar issue, but with a different rule (DS173237). |
We'll take a look at these rules. We are working on an update to the rules engine to allow us to pull in more context in our rules (like checking if a pattern occurs just before xmlns and NOT triggering it). In the interim, you can disable specific rules or analysis in a particular file in the DevSkim settings in the VS Code version of the plugin the setting would look like
or
|
@joshbw What would be the setting in VS and where to set it. Otherwise this really meaningful extension is becomming completely useless. |
@lennybacon , what would you prefer that feature look a like? I'm implementing that functionality in VS and would be happy to get a feedback on potential approaches:
Both options can come with import/export feature from/into VS Code compatible JSON settings. |
@PavelBansky, I think option 1 makes more sense, as the entry level for this extension should be as low as possible to make its reach as broad as possible. |
This is still an issue, i propose reopening it |
@Ronald245 which client are you using (VS, VS Code, Sublime)? We added the ability to have additional conditions fire to hone in on an issue, so we now invalidate a finding if it is the xmlns, but it is possible we forgot to update one of the clients with the altered rule |
@joshbw Visual studio 2017, it's worth noting however that i havent seen the extension update in a while, |
Sorry, all the effort went to Command Line Tool and making rules better. The VS 2017 extension will be updated next. |
@PavelBansky Any updates/plans for VS2017 Extension yet? |
The latest version (0.3.1) is now available in the VS gallery. The arbitrary enabling and disabling of individual rules is not, yet implemented in this version. |
I'm closing this issue for now. |
So far I am happy with the plugin, but most of the time I am ignoring errors for web pages that are mentioned in the xml docu or xml namespace (which btw. kills visual studio 2015). It would be nice if there would be an option to ignore links in the xml docu like:
/// <para tool="javadoc-to-mdoc"> /// <format type="text/html"> /// <a href="http://developer.android.com/reference/android/app/Activity.html#onStop()" target="_blank">[Android Documentation]</a> /// </format> /// </para>
Bg
The text was updated successfully, but these errors were encountered: