Skip to content

Commit

Permalink
Fix Respecting Ignored Ids in VsCode extension (#461)
Browse files Browse the repository at this point in the history
* Fix RimRaf call with new version

* Update vsce

* Fix Respecting ignored rules
  • Loading branch information
gfs authored Mar 15, 2023
1 parent 18c5758 commit 427a6a8
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ internal static void SetScannerSettings(IConfiguration configuration)
StaticScannerSettings.RuleProcessorOptions = OptionsFromConfiguration(configuration);
StaticScannerSettings.IgnoreDefaultRuleSet = configuration.GetValue<bool>($"{Section}:ignores:ignoreDefaultRules");
StaticScannerSettings.CustomRulePaths = CompileList<string>(configuration, "rules:customRulesPaths");
StaticScannerSettings.IgnoreRuleIds = CompileList<string>(configuration, "ignores:ignoreRuleList");
StaticScannerSettings.IgnoreRuleIds = configuration.GetValue<string>($"{Section}:ignores:ignoreRulesList").Split(',');
List<Regex> fileIgnoreRegexes = new();
foreach (string potentialRegex in CompileList<string>(configuration, "ignores:ignoreFiles"))
{
Expand Down
19 changes: 9 additions & 10 deletions DevSkim-DotNet/Microsoft.DevSkim.LanguageServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,21 @@ public static void Main(string[] args)

private static async Task MainAsync(string[] args)
{
#if DEBUG
// Debugger.Launch();
// while (!Debugger.IsAttached)
// {
// await Task.Delay(100);
// }

#if DEBUG
//while (!Debugger.IsAttached)
//{
// await Task.Delay(100);
//}
Log.Logger = new LoggerConfiguration()
.Enrich.FromLogContext()
.WriteTo.File("devskim-server-log.txt", rollingInterval: RollingInterval.Day)
.MinimumLevel.Verbose()
.CreateLogger();
#else
// Creates a "silent" logger
Log.Logger = new LoggerConfiguration().CreateLogger();
#endif
#else
// Creates a "silent" logger
Log.Logger = new LoggerConfiguration().CreateLogger();
#endif

Log.Logger.Debug("Configuring server...");
IObserver<WorkDoneProgressReport> workDone = null!;
Expand Down
28 changes: 21 additions & 7 deletions DevSkim-VSCode-Plugin/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 10 additions & 10 deletions DevSkim-VSCode-Plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@
"title": "Scan all files in the workspace"
}
],
"configuration":
[
"configuration": [
{
"order": 10,
"id": "MS-CST-E.vscode-devskim.rules",
Expand Down Expand Up @@ -176,7 +175,7 @@
}
},
{
"order": 40,
"order": 40,
"id": "MS-CST-E.vscode-devskim.ignores",
"title": "Ignores",
"properties": {
Expand Down Expand Up @@ -238,7 +237,7 @@
"type": "boolean",
"default": true,
"description": "Scan files on save."
},
},
"MS-CST-E.vscode-devskim.triggers.scanOnChange": {
"type": "boolean",
"default": true,
Expand Down Expand Up @@ -271,10 +270,10 @@
],
"scripts": {
"clean": "npm run clean:net && npm run clean:out && npm run clean:modules && npm run clean:vsix",
"clean:net": "npx --quiet rimraf devskimBinaries",
"clean:out": "npx --quiet rimraf **/out **/tsconfig.tsbuildinfo",
"clean:modules": "npx --quiet rimraf **/node_modules",
"clean:vsix": "npx --quiet rimraf *.vsix",
"clean:net": "npx --quiet -y rimraf devskimBinaries",
"clean:out": "npx --quiet -y rimraf --glob **/out && npx --quiet -y rimraf --glob **/tsconfig.tsbuildinfo",
"clean:modules": "npx --quiet -y rimraf --glob **/node_modules",
"clean:vsix": "npx --quiet -y rimraf --glob *.vsix",
"net-setup": "dotnet publish -c Debug -f net7.0 ../DevSkim-DotNet/Microsoft.DevSkim.LanguageServer -o devskimBinaries",
"net-setup:release": "dotnet publish -c Release -f net7.0 ../DevSkim-DotNet/Microsoft.DevSkim.LanguageServer -o devskimBinaries",
"setup": "npm install && npm run net-setup",
Expand All @@ -289,7 +288,8 @@
"esbuild-base": "esbuild ./client/extension.ts --bundle --outfile=client/out/extension.js --external:vscode --format=cjs --platform=node",
"esbuild": "npm run esbuild-base -- --sourcemap",
"esbuild-watch": "npm run esbuild-base -- --sourcemap --watch",
"pack-ext": "npm run clean:out && npm run clean:modules && npm run setup:release && node ./scripts/setPackageVersion.js && ((node ./scripts/checkPreReleaseFlag.js && (vsce package --pre-release || echo 'Pre-Release build failed')) || (vsce package || echo 'Release build failed')) && node ./scripts/resetPackageVersion.js"
"pack-ext": "npm run clean:out && npm run clean:modules && npm run setup:release && node ./scripts/setPackageVersion.js && ((node ./scripts/checkPreReleaseFlag.js && (vsce package --pre-release || echo 'Pre-Release build failed')) || (vsce package || echo 'Release build failed')) && node ./scripts/resetPackageVersion.js",
"pack-ext:debug": "npm run clean:out && npm run clean:modules && npm run setup && node ./scripts/setPackageVersion.js && ((node ./scripts/checkPreReleaseFlag.js && (vsce package --pre-release || echo 'Pre-Release build failed')) || (vsce package || echo 'Release build failed')) && node ./scripts/resetPackageVersion.js"
},
"devDependencies": {
"@types/node": "^14.x",
Expand All @@ -299,6 +299,6 @@
"eslint": "^8.8.0",
"nerdbank-gitversioning": "^3.4.255",
"typescript": "^4.5.5",
"@vscode/vsce": "^2.14.0"
"@vscode/vsce": "^2.18.0"
}
}

0 comments on commit 427a6a8

Please sign in to comment.