Skip to content
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

Rewrite DevSkim to use the Application Inspector Engine #390

Merged
merged 33 commits into from
Aug 12, 2022
Merged

Conversation

gfs
Copy link
Contributor

@gfs gfs commented Jul 27, 2022

This is intended to complete #367.

Fixes #389
Fixes #148
Fixes #364

Also planned for this refactor, but not present in this PR:
#384
#385
#383
#381
#343
#303
#289
#217

gfs added 10 commits July 26, 2022 22:56
Refactor DevSkim to use AI engine. I'm refactoring it in a separate project, which will then be tested against the original devskim using the same rules to validate behavior, then the "DevSkim.AI" project will be renamed back to "Microsoft.DevSkim" and the old version removed.
Trimmed down to the Analyze and Verify commands by leveraging the refactored AI based engine.

Pack command is no longer needed. Multiple rules files are simply embedded.
Catalogue command not implemented for now. I'm not clear on how useful it is.
Test command not implemented for now. Also not clear how much use it sees.
Adds initial test to validate the default rules.
Cleans up the gitignore in the dotnet dir.
CLI Analyze Now Runs and appears to be working.
Remainder of Enums which used dashes have been renamed.
Now load DevSkim's languages and comments rather than using App inspectors.
Confirmed via some manual testing that new implementation does not miss any matches the old one found. And in fact it finds some matches that were not appearing with old engine.
@gfs gfs mentioned this pull request Aug 5, 2022
public void DenamespacedRule()
{
var content = @"<?xml version=""1.0"" encoding=""UTF-8""?>
<project xmlns=""http://maven.apache.org/POM/4.0.0"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xsi:schemaLocation=""http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"">

Check failure

Code scanning / devskim

Insecure URL

Insecure URL
To allow refactored CLI build to work properly. Will be restored when rewritten extension is added back.
@gfs gfs marked this pull request as ready for review August 11, 2022 18:26
@gfs gfs merged commit 36bfd71 into main Aug 12, 2022
@gfs gfs deleted the gfs/AiRewrite branch August 12, 2022 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant