Skip to content

AvoidCopyAlways Check#11054

Merged
JanKrivanek merged 14 commits intomainfrom
proto/copyalways-check
Dec 10, 2024
Merged

AvoidCopyAlways Check#11054
JanKrivanek merged 14 commits intomainfrom
proto/copyalways-check

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
@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