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

SLVS-1697 Integrate Reproducer command with SLCore analysis #5905

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Integration.Vsix/CFamily/CFamilyReproducerCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ private void TriggerReproducer()
{
var options = new CFamilyAnalyzerOptions
{
IsOnOpen = false,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really needed? If so, I would add a comment explaining why (by default bool properties are initialized with false and if I would ever touch this code I will tend to remove the explicit initialization).
From my point of view adding a test case to catch if this value changes would be better.

CreateReproducer = true
};

Expand Down
1 change: 1 addition & 0 deletions src/SLCore.UnitTests/Analysis/SLCoreAnalyzerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ public void ExecuteAnalysis_CFamilyReproducerEnabled_SetsExtraProperty()
SetUpCompilationDatabaseLocator(filePath, CreateCompilationDatabaseHandle("somepath"));
SetUpInitializedConfigScope();
var cFamilyAnalyzerOptions = Substitute.For<ICFamilyAnalyzerOptions>();
cFamilyAnalyzerOptions.IsOnOpen.Returns(false);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please extract the mock of ICFamilyAnalyzerOptions into a separate method to avoid creating too much noise in the test (lines 192-194)

cFamilyAnalyzerOptions.CreateReproducer.Returns(true);

testSubject.ExecuteAnalysis(filePath, analysisId, [AnalysisLanguage.CFamily], cFamilyAnalyzerOptions, default);
Expand Down