-
-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate analyzers via msbuild (#2968)
* integrate analyzers via msbuild magic * try wildcard for sarif upload, might need to change to directory * try another wildcard for sarif files * collect sarif files in dedicated directory to be able to upload them with github/codeql-action/upload-sarif * add back env vars * remove stale open statement * update analyzers tool and gr analyzers package * move setting of env vars * delete "Directory.Solution.props" * remove message * needs some UsingTask magic I don't know currently * fix build for now * cool kids project cracking * restore all fail-on-warnings * use analysisreports dir * use $(SolutionFileName) instead of hard coding name * Set environment variables in target. --------- Co-authored-by: nojaf <[email protected]>
- Loading branch information
Showing
17 changed files
with
99 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,4 +201,4 @@ tests/.repositories/** | |
|
||
# Analyzer files | ||
.analyzerpackages | ||
analysis.sarif | ||
*.sarif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<Project> | ||
|
||
<Target | ||
Name="AnalyzeProject" | ||
DependsOnTargets="Restore;ResolveAssemblyReferencesDesignTime;ResolveProjectReferencesDesignTime;ResolvePackageDependenciesDesignTime;FindReferenceAssembliesForReferences;_GenerateCompileDependencyCache;_ComputeNonExistentFileProperty;BeforeBuild;BeforeCompile;CoreCompile"> | ||
|
||
<Message Importance="normal" Text="fsc arguments: @(FscCommandLineArgs)" /> | ||
<Message Importance="High" Text="Analyzing $(MSBuildProjectFile)"/> | ||
<PropertyGroup> | ||
<DOTNET_ROLL_FORWARD_TO_PRERELEASE>1</DOTNET_ROLL_FORWARD_TO_PRERELEASE> | ||
<DOTNET_ROLL_FORWARD>LatestMajor</DOTNET_ROLL_FORWARD> | ||
</PropertyGroup> | ||
<Exec | ||
ContinueOnError="true" | ||
Command="dotnet fsharp-analyzers --fsc-args "@(FscCommandLineArgs)" --analyzers-path "$(PkgG-Research_FSharp_Analyzers)\analyzers\dotnet\fs" --exclude-analyzer PartialAppAnalyzer --fail-on-warnings GRA-STRING-001 GRA-STRING-002 GRA-STRING-003 GRA-UNIONCASE-001 --verbose --report "../../analysisreports/$(MSBuildProjectName)-analysis.sarif""> | ||
<Output TaskParameter="ExitCode" PropertyName="LastExitCode" /> | ||
</Exec> | ||
<Error Condition="'$(LastExitCode)' == '-2'" Text="Problems were found $(MSBuildProjectFile)" /> | ||
|
||
</Target> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project> | ||
|
||
<ItemGroup> | ||
<ProjectsToAnalyze Include="src\**\*.fsproj" Exclude="src\Fantomas.FCS\Fantomas.FCS.fsproj"/> | ||
</ItemGroup> | ||
|
||
<Target Name="AnalyzeSolution"> | ||
<Exec Command="dotnet build -c Release $(SolutionFileName)" /> | ||
<MSBuild | ||
Projects="@(ProjectsToAnalyze)" | ||
Targets="AnalyzeProject" | ||
Properties="DesignTimeBuild=True;Configuration=Release;ProvideCommandLineArgs=True;SkipCompilerExecution=True" /> | ||
</Target> | ||
|
||
</Project> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters