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

Allow setting configuration property #2357

Merged
merged 3 commits into from
Feb 17, 2023
Merged

Conversation

JimBobSquarePants
Copy link
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

The property was internal when it shouldn't be.

@@ -15,15 +15,21 @@ public sealed class DecoderOptions

private uint maxFrames = int.MaxValue;

// Used by the FileProvider in the unit tests to set the configuration on the fly.
Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah. I know. This is nasty but so is the file provider.

Comment on lines 19 to 21
#pragma warning disable SA1401 // Fields should be private
internal Configuration BackingConfiguration = Configuration.Default;
#pragma warning restore SA1401 // Fields should be private
Copy link
Member

Choose a reason for hiding this comment

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

Why not a member SetConfiguration() method and a private field?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah... I was trying to avoid adding to the method itself and overcomplicated things. I moved it but still had to suppress a warning as the IDE thinks incorrectly that it can be an auto-implemented property.

Copy link
Member

@antonfirsov antonfirsov left a comment

Choose a reason for hiding this comment

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

I would expect these analyzers to be smarter 😞

@JimBobSquarePants JimBobSquarePants merged commit 08f6d73 into main Feb 17, 2023
@JimBobSquarePants JimBobSquarePants deleted the js/decoder-options branch February 17, 2023 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants