Skip to content

Add ruleset as input to fast up to date #2464

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

Merged
merged 3 commits into from
Jun 21, 2017
Merged

Add ruleset as input to fast up to date #2464

merged 3 commits into from
Jun 21, 2017

Conversation

panopticoncentral
Copy link
Contributor

@panopticoncentral panopticoncentral commented Jun 19, 2017

Customer scenario

The user's SDK-based project uses a ruleset as input to project analyzers. The user changes the ruleset to include rules that would cause the project to no longer build due to new errors. The user builds but because we didn't take into account the change to the ruleset, we think the project is up to date and the build is incorrectly successful.

Bugs this fixes:

Fixes #2374

Workarounds, if any

User would have to perform a rebuild.

Risk

Low, this just adds a new file into the up to date check. Biggest risk is that we would think a project was not up to date when it was, resulting in calling MSBuild.

Performance impact

Low, looks at one additional file.

Is this a regression from a previous update?

No.

@srivatsn
Copy link
Contributor

Can we instead make a change to designtime.targets to add:

<UpToDateCheckInputFile Include="@(CodeAnalysisRuleSet)" />

and avoid special casing in the PS?

@davkean
Copy link
Member

davkean commented Jun 20, 2017

Was just about to ask exactly the same thing...

@panopticoncentral
Copy link
Contributor Author

It seems a little funny to be putting non-designtime stuff into a targets named "designtime," but sure...

@@ -282,6 +283,7 @@ private HashSet<string> CollectInputs(Logger logger)
var inputs = new HashSet<string>();

AddInput(logger, inputs, _msBuildProjectFullPath, "project file");

Copy link
Contributor

Choose a reason for hiding this comment

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

whitespace

@@ -25,6 +25,11 @@
<SuppressOutOfDateMessageOnBuild Condition="'$(SuppressOutOfDateMessageOnBuild)' == ''">true</SuppressOutOfDateMessageOnBuild>
</PropertyGroup>

<!-- If the project we're compiling has a ruleset, make sure we check it for up-to-date checks. -->
<ItemGroup Condition="'$(CodeAnalysisRuleSet)' != ''">
Copy link
Contributor

Choose a reason for hiding this comment

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

Make sure to verify that this doesn't do anything wonky in the old PS (the designtime targets are imported by non-SDK projects as well).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't look like the old PS took rulesets into account for fast up to date, so this will add it there, too. I'll check to make sure it doesn't change anything, but I assume it's OK to extend the old PS as well?

@srivatsn
Copy link
Contributor

Tagging @MattGertz for Preview4

@davkean
Copy link
Member

davkean commented Jun 21, 2017

"DesignTime" == "things needed to make VisualStudio work".

@panopticoncentral
Copy link
Contributor Author

'When I use a word,' Humpty Dumpty said, in rather a scornful tone, 'it means just what I choose it to mean — neither more nor less.'

@panopticoncentral
Copy link
Contributor Author

:-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fastuptodate should check analyzers, rulesets and editorconfigs
5 participants