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

AvoidCopyAlways Check #11054

Merged
merged 14 commits into from
Dec 10, 2024
Merged

AvoidCopyAlways Check #11054

merged 14 commits into from
Dec 10, 2024

Conversation

JanKrivanek
Copy link
Member

Fixes #7654

Context

Adding a check validating that Always is not being used for CopyToOutputDirectory metadata. Or that the SkipUnchangedFilesOnCopyAlways property is set to True to avoid unnecessary copying.

Testing

Tailored tests added - covering as well the #11052

@JanKrivanek JanKrivanek force-pushed the proto/copyalways-check branch from 8ade309 to 83099b9 Compare December 4, 2024 15:26
Base automatically changed from proto/copy-if-different to main December 5, 2024 16:05
Copy link
Member

@YuliiaKovalova YuliiaKovalova left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@JanKrivanek JanKrivanek merged commit 1d70cb3 into main Dec 10, 2024
10 checks passed
@JanKrivanek JanKrivanek deleted the proto/copyalways-check branch December 10, 2024 19:24
* `PreserveNewest`
* `IfDifferent`

`Always` is not recommended, as it causes the files to be copied in every build, even when the destination file content is identical to the source.

Choose a reason for hiding this comment

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

given that it is not recommended; should it be listed last?

public override IReadOnlyList<CheckRule> SupportedRules { get; } = [SupportedRule];

public override void Initialize(ConfigurationContext configurationContext)
{

Choose a reason for hiding this comment

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

bodyless inherited method; by design?

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.

New diagnostic proposal: erroring on CopyToOutputDirectory="Always"
5 participants