From 1e79b24a91b2f1f0327b9e99d51928c0b2ae0730 Mon Sep 17 00:00:00 2001
From: Gabe Stocco <98900+gfs@users.noreply.github.com>
Date: Tue, 29 Aug 2023 11:52:55 -0700
Subject: [PATCH] Remove workaround for missing Sarif Schema (#583)
* Update dependencies
* Remove workaround for missing sarif schema as it is now available
* Fix ordering in suggested action source
---
Changelog.md | 10 ++++++++++
.../Microsoft.DevSkim.CLI/Microsoft.DevSkim.CLI.csproj | 4 ++--
.../Microsoft.DevSkim.CLI/Writers/SarifWriter.cs | 4 +---
.../Microsoft.DevSkim.LanguageServer.csproj | 2 +-
.../Microsoft.DevSkim.Tests.csproj | 2 +-
...crosoft.DevSkim.VisualStudio.SourceGenerator.csproj | 2 +-
.../Microsoft.DevSkim.VisualStudio.csproj | 6 +++---
.../SuggestionActionsSource.cs | 5 ++++-
.../Microsoft.DevSkim/Microsoft.DevSkim.csproj | 2 +-
9 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/Changelog.md b/Changelog.md
index cb0f3130..ac775fdc 100644
--- a/Changelog.md
+++ b/Changelog.md
@@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [1.0.20] - 2023-08-28
+### Fixes
+Removes workaround for 404 sarif schema uri
+
+### Dependencies
+Updates dependencies to latest.
+
+### VS Extension
+Fix ordering of proposed fixes in UX. #582
+
## [1.0.19] - 2023-08-22
### VS Extension
Fix concurrent access issue with cache storage for fixes. Fix #480
diff --git a/DevSkim-DotNet/Microsoft.DevSkim.CLI/Microsoft.DevSkim.CLI.csproj b/DevSkim-DotNet/Microsoft.DevSkim.CLI/Microsoft.DevSkim.CLI.csproj
index 8391f23a..a374ce36 100644
--- a/DevSkim-DotNet/Microsoft.DevSkim.CLI/Microsoft.DevSkim.CLI.csproj
+++ b/DevSkim-DotNet/Microsoft.DevSkim.CLI/Microsoft.DevSkim.CLI.csproj
@@ -37,9 +37,9 @@
-
+
-
+
diff --git a/DevSkim-DotNet/Microsoft.DevSkim.CLI/Writers/SarifWriter.cs b/DevSkim-DotNet/Microsoft.DevSkim.CLI/Writers/SarifWriter.cs
index 438fff68..f7059bb0 100644
--- a/DevSkim-DotNet/Microsoft.DevSkim.CLI/Writers/SarifWriter.cs
+++ b/DevSkim-DotNet/Microsoft.DevSkim.CLI/Writers/SarifWriter.cs
@@ -104,9 +104,7 @@ public override void FlushAndClose()
rule["level"] = "warning";
}
- // Begin Workaround for https://github.com/microsoft/sarif-sdk/issues/2662
- // The default provided schema is 404, so replace it with a 2.1.0 that is available.
- reReadLog["$schema"] = "https://www.schemastore.org/schemas/json/sarif-2.1.0.json";
+ // Write out the fixed sarif
using var jsonWriter = new JsonTextWriter(TextWriter);
reReadLog.WriteTo(jsonWriter);
// Add a newline at the end to make logging messages cleaner
diff --git a/DevSkim-DotNet/Microsoft.DevSkim.LanguageServer/Microsoft.DevSkim.LanguageServer.csproj b/DevSkim-DotNet/Microsoft.DevSkim.LanguageServer/Microsoft.DevSkim.LanguageServer.csproj
index d1b4cf22..504a60fd 100644
--- a/DevSkim-DotNet/Microsoft.DevSkim.LanguageServer/Microsoft.DevSkim.LanguageServer.csproj
+++ b/DevSkim-DotNet/Microsoft.DevSkim.LanguageServer/Microsoft.DevSkim.LanguageServer.csproj
@@ -13,7 +13,7 @@
-
+
diff --git a/DevSkim-DotNet/Microsoft.DevSkim.Tests/Microsoft.DevSkim.Tests.csproj b/DevSkim-DotNet/Microsoft.DevSkim.Tests/Microsoft.DevSkim.Tests.csproj
index 8ce78e00..0b0f858b 100644
--- a/DevSkim-DotNet/Microsoft.DevSkim.Tests/Microsoft.DevSkim.Tests.csproj
+++ b/DevSkim-DotNet/Microsoft.DevSkim.Tests/Microsoft.DevSkim.Tests.csproj
@@ -9,7 +9,7 @@
-
+
diff --git a/DevSkim-DotNet/Microsoft.DevSkim.VisualStudio.SourceGenerator/Microsoft.DevSkim.VisualStudio.SourceGenerator.csproj b/DevSkim-DotNet/Microsoft.DevSkim.VisualStudio.SourceGenerator/Microsoft.DevSkim.VisualStudio.SourceGenerator.csproj
index 4e729a89..ffbb524d 100644
--- a/DevSkim-DotNet/Microsoft.DevSkim.VisualStudio.SourceGenerator/Microsoft.DevSkim.VisualStudio.SourceGenerator.csproj
+++ b/DevSkim-DotNet/Microsoft.DevSkim.VisualStudio.SourceGenerator/Microsoft.DevSkim.VisualStudio.SourceGenerator.csproj
@@ -13,7 +13,7 @@
-
+
diff --git a/DevSkim-DotNet/Microsoft.DevSkim.VisualStudio/Microsoft.DevSkim.VisualStudio.csproj b/DevSkim-DotNet/Microsoft.DevSkim.VisualStudio/Microsoft.DevSkim.VisualStudio.csproj
index cd40e3a5..b9542921 100644
--- a/DevSkim-DotNet/Microsoft.DevSkim.VisualStudio/Microsoft.DevSkim.VisualStudio.csproj
+++ b/DevSkim-DotNet/Microsoft.DevSkim.VisualStudio/Microsoft.DevSkim.VisualStudio.csproj
@@ -85,14 +85,14 @@
-
+
- 17.6.42
+ 17.7.20
17.2.8
-
+
compile; build; native; contentfiles; analyzers; buildtransitive
diff --git a/DevSkim-DotNet/Microsoft.DevSkim.VisualStudio/SuggestionActionsSource.cs b/DevSkim-DotNet/Microsoft.DevSkim.VisualStudio/SuggestionActionsSource.cs
index de726528..325ced5e 100644
--- a/DevSkim-DotNet/Microsoft.DevSkim.VisualStudio/SuggestionActionsSource.cs
+++ b/DevSkim-DotNet/Microsoft.DevSkim.VisualStudio/SuggestionActionsSource.cs
@@ -48,7 +48,10 @@ public IEnumerable GetSuggestedActions(ISuggestedActionCateg
{
if (dictForFile.TryGetValue(wordExtent.Span.Snapshot.Version.VersionNumber, out ConcurrentDictionary fixes))
{
- suggestedActions.AddRange(fixes.Where(codeFixMapping => Intersects(codeFixMapping.Key, wordExtent)).Select(intersectedMapping => new DevSkimSuggestedAction(wordExtent.Span, intersectedMapping.Key)));
+ suggestedActions.AddRange(fixes.Where(codeFixMapping =>
+ Intersects(codeFixMapping.Key, wordExtent))
+ .OrderBy(fix => fix.Key.friendlyString)
+ .Select(intersectedMapping => new DevSkimSuggestedAction(wordExtent.Span, intersectedMapping.Key)));
}
}
yield return new SuggestedActionSet(suggestedActions, wordExtent.Span);
diff --git a/DevSkim-DotNet/Microsoft.DevSkim/Microsoft.DevSkim.csproj b/DevSkim-DotNet/Microsoft.DevSkim/Microsoft.DevSkim.csproj
index ed94962b..f1b8f5c0 100644
--- a/DevSkim-DotNet/Microsoft.DevSkim/Microsoft.DevSkim.csproj
+++ b/DevSkim-DotNet/Microsoft.DevSkim/Microsoft.DevSkim.csproj
@@ -24,7 +24,7 @@
-
+