Skip to content

feat: Enable Rule CA2211 - #10878

Merged
jeromelaban merged 2 commits into
unoplatform:feature/breaking-changesfrom
workgroupengineering:features/Analyzers/CA2211
Feb 24, 2023
Merged

jeromelaban merged 2 commits into
unoplatform:feature/breaking-changesfrom
workgroupengineering:features/Analyzers/CA2211

Conversation

@workgroupengineering

@workgroupengineering workgroupengineering commented Jan 3, 2023 •

Copy link
Copy Markdown
Contributor

GitHub Issue (If applicable): #8339

PR Type

What kind of change does this PR introduce?

What is the current behavior?

What is the new behavior?

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@github-actions github-actions Bot added platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform labels Jan 3, 2023
Comment thread .editorconfig Resolved

@Youssef1313 Youssef1313 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please delete this entry:

<Rule Id="CA2211" Action="Warning" />

@workgroupengineering

Copy link
Copy Markdown
Contributor Author

@MartinZikmund

Why are they public static fields?

/// <summary>
/// The default downloader instance used by all the new instances of <see cref="ImageSource"/>.
/// </summary>
public static IImageSourceDownloader DefaultDownloader;
/// <summary>
/// The image downloader for the current instance.
/// </summary>
public IImageSourceDownloader Downloader;
/// <summary>
/// Initializes the Uno image downloader.
/// </summary>
private void InitializeDownloader()
{
Downloader = DefaultDownloader;
}

Can i converted in protected properties?

@github-actions github-actions Bot added area/build Categorizes an issue or PR as relevant to build infrastructure platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform labels Jan 4, 2023
Comment thread build/nVentive-generic.ruleset Resolved
Comment thread src/Uno.UI/FeatureConfiguration.cs Resolved
@MartinZikmund

Copy link
Copy Markdown
Member

@MartinZikmund

Why are they public static fields?

/// <summary>
/// The default downloader instance used by all the new instances of <see cref="ImageSource"/>.
/// </summary>
public static IImageSourceDownloader DefaultDownloader;
/// <summary>
/// The image downloader for the current instance.
/// </summary>
public IImageSourceDownloader Downloader;
/// <summary>
/// Initializes the Uno image downloader.
/// </summary>
private void InitializeDownloader()
{
Downloader = DefaultDownloader;
}

Can i converted in protected properties?

I am not sure if these are used by some apps or not (to avoid a breaking change). @carldebilly do you know? Maybe they could be moved to FeatureConfiguration?

@workgroupengineering

workgroupengineering commented Jan 4, 2023 •

Copy link
Copy Markdown
Contributor Author

@carldebilly there are also

public static Func<IFragmentTracker> DefaultFragmentTracker;

public static Func<string, string>? InvokeJSOverride;

@github-actions github-actions Bot added the platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform label Jan 4, 2023
@github-actions github-actions Bot added the area/skia ✏️ Categorizes an issue or PR as relevant to Skia label Feb 7, 2023
@workgroupengineering
workgroupengineering force-pushed the features/Analyzers/CA2211 branch 2 times, most recently from 13345df to 1e6efaa Compare February 8, 2023 08:31
@workgroupengineering
workgroupengineering marked this pull request as ready for review February 8, 2023 08:31

@Youssef1313 Youssef1313 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, assuming @jeromelaban is good with those small breaking changes done in master.

@Youssef1313

Copy link
Copy Markdown
Member

Note: I would prefix this either "chore: " or "build: ". This doesn't seem like a feature IMO.

But @jeromelaban can confirm.

@jeromelaban

Copy link
Copy Markdown
Member

Thanks for the PR! This is a breaking change that we can't have in 4.x builds, so let's move it to our breaking changes branch.

@jeromelaban
jeromelaban changed the base branch from master to feature/breaking-changes February 8, 2023 14:38
@jeromelaban

Copy link
Copy Markdown
Member

You'll need to rebase your changes on top of the feature/breaking-changes branch

@Youssef1313

Youssef1313 commented Feb 8, 2023 •

Copy link
Copy Markdown
Member

@jeromelaban @workgroupengineering Let's wait until we rebase feature/breaking-changs on latest master to avoid additional conflicts?

@workgroupengineering
workgroupengineering marked this pull request as draft February 8, 2023 14:54
@jeromelaban
jeromelaban force-pushed the feature/breaking-changes branch from f6c0d72 to 67351e3 Compare February 15, 2023 13:39
@Youssef1313

Copy link
Copy Markdown
Member

@jeromelaban Is this one ready to merge now?

@jeromelaban jeromelaban left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like it is! Thanks!

@jeromelaban
jeromelaban marked this pull request as ready for review February 15, 2023 18:39
@workgroupengineering

Copy link
Copy Markdown
Contributor Author

Since this PR has been moved to the breaking-changes branch, I will move the following static fields to the FeatureConfiguration.
What do you think?

/// <summary>
/// The default downloader instance used by all the new instances of <see cref="ImageSource"/>.
/// </summary>
public static IImageSourceDownloader DefaultDownloader;
/// <summary>
/// The image downloader for the current instance.
/// </summary>
public IImageSourceDownloader Downloader;
/// <summary>
/// Initializes the Uno image downloader.
/// </summary>
private void InitializeDownloader()
{
Downloader = DefaultDownloader;
}

public static Func<IFragmentTracker> DefaultFragmentTracker;

public static Func<string, string>? InvokeJSOverride;

@workgroupengineering
workgroupengineering marked this pull request as draft February 16, 2023 09:34
@Youssef1313

Copy link
Copy Markdown
Member

@workgroupengineering Maybe some/all of these should be removed completely rather than being in FeatureConfiguration?

@workgroupengineering

Copy link
Copy Markdown
Contributor Author

Maybe some/all of these should be removed completely rather than being in FeatureConfiguration?

I agree, but not knowing who uses them I would do things in two steps, first moving them and marking them as obsolete and then remove them.

@jeromelaban

Copy link
Copy Markdown
Member

Since this PR has been moved to the breaking-changes branch, I will move the following static fields to the FeatureConfiguration.
What do you think?

Let's take a look in a different PR, but it makes sense.

@workgroupengineering
workgroupengineering marked this pull request as ready for review February 18, 2023 17:13
@jeromelaban
jeromelaban merged commit f91709b into unoplatform:feature/breaking-changes Feb 24, 2023
@workgroupengineering
workgroupengineering deleted the features/Analyzers/CA2211 branch February 24, 2023 22:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/build Categorizes an issue or PR as relevant to build infrastructure area/skia ✏️ Categorizes an issue or PR as relevant to Skia platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform platform/ios 🍎 Categorizes an issue or PR as relevant to the iOS platform platform/macos 🍏 Categorizes an issue or PR as relevant to the macOS platform platform/wasm 🌐 Categorizes an issue or PR as relevant to the WebAssembly platform

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants