Skip to content

Add <inheritdoc /> in migrations - #27268

Merged
roji merged 1 commit into
dotnet:mainfrom
roji:MigrationsInheritDoc
Jan 28, 2022
Merged

roji merged 1 commit into
dotnet:mainfrom
roji:MigrationsInheritDoc

Conversation

@roji

@roji roji commented Jan 24, 2022 •

Copy link
Copy Markdown
Member

And suppress CA1814 if multidimensional seed data is present.

Closes #10695

@roji
roji requested a review from a team January 24, 2022 15:20
@roji
roji marked this pull request as draft January 24, 2022 15:21
@roji
roji force-pushed the MigrationsInheritDoc branch from 70e4b7f to 1a947b5 Compare January 24, 2022 19:39
@roji
roji marked this pull request as ready for review January 24, 2022 19:40
@roji
roji requested a review from dougbu as a code owner January 24, 2022 19:40
@roji
roji force-pushed the MigrationsInheritDoc branch from 1a947b5 to c6f874d Compare January 24, 2022 19:48
@roji
roji marked this pull request as draft January 24, 2022 20:01
@roji
roji force-pushed the MigrationsInheritDoc branch from c6f874d to a9d9d25 Compare January 25, 2022 19:41
And suppress CA1814 if multidimensional seed data is present.

Closes dotnet#10695
@roji
roji force-pushed the MigrationsInheritDoc branch from a9d9d25 to 2ea6081 Compare January 25, 2022 19:41
@roji
roji marked this pull request as ready for review January 25, 2022 19:41
.AppendLine("#nullable disable");

// Suppress "Prefer jagged arrays over multidimensional" when we have a seeding operation with a multidimensional array
if (HasMultidimensionalArray(upOperations.Concat(downOperations)))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

How is this related to inheritdoc?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It isn't - it's another thing in the same area that's tracked by that same issue (see #10695 (comment)). Do you prefer I split it out, or think we shouldn't do it?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we should at least discuss. I really hate adding suppressions, especially for overzealous warnings like this. Is this a modern analyzer warning? If so, what is the justification for it? If it's an old FxCop warning then...

@roji roji Jan 27, 2022 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This rule is reported by the standard .NET analyzers that started shipping as part of the SDK in .NET 5.0 (see docs). It's indeed not enabled by default, but anyone enabling e.g. all the "performance" category diagnostics gets it.

I also hate adding suppressions, which is why I went to the extra trouble of adding it only where we actually generate a multidimensional array. I do think it reduces a bit of needless friction for users who enable most of the rules, but if you're against it we can discuss and remove.

@bricelam bricelam mentioned this pull request Jan 28, 2022
@roji
roji merged commit a204b62 into dotnet:main Jan 28, 2022
@roji
roji deleted the MigrationsInheritDoc branch January 28, 2022 21:53
Comment thread eng/Versions.props
</PropertyGroup>
<PropertyGroup Label="Other dependencies">
<MicrosoftCodeAnalysisVersion>3.7.0</MicrosoftCodeAnalysisVersion>
<MicrosoftCodeAnalysisVersion>4.0.1</MicrosoftCodeAnalysisVersion>

@bricelam bricelam Jan 28, 2022 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you move the following comment to here?

<!-- NB: Version affects the minimum required Visual Studio version -->
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisVersion)" PrivateAssets="all" />

@bricelam bricelam Jan 28, 2022 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Doh, I was too slow to comment; you already merged

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh sorry... Can slip it into the next thing (either you or me).

Any idea what 4.0.1 restricts us to in terms of VS?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Add inheritdoc to migration files

3 participants