Hey everyone! I've been working on getting rid of our build warnings - stylecop and compiler.
There are 3 categories of warnings left, and I need your help on deciding how to fix those 馃槃
1. SA1649 - File name must match first type name (4)
This is happening for all classes where we have a generic version and a regular version which share the same name - Brushes, ImageBrush, etc. and we use the convention of {name}`{numberOfTypes}.cs for the file name.
The options I see are:
I would personally like a better distinction between the T and non T versions, and that would also help with the readability of the code.
2. SA1401 - Field must be private (4)
This is happening in JpegDecoderCore only, where we have some internal fields, like below.
/// <summary>
/// The byte buffer.
/// </summary>
internal Bytes Bytes;
This is a maintainability rule - the best practice is to keep all fields to private, and if anything needs to be exposed it should be done via properties.
Should we change these fields to properties? I'm not very familiar with this code so I'm hoping you will have more reasons for one option or the other.
3. CS0219 - The variable <> is assigned but its value is never used (4)
This is in the test project in ReferenceImplementations. r0 and r4 variables are never used. The fix to remove them is trivial, but I was wondering if them not being used is actually intentional.
I would personally just rename the generic files (and header) to the style StyleCop wants rather than fighting with it.
I.E. Just rename Brushes`2.cs toBrushes{TColor,TPacked}.cs.
@olivif Nice work!
- SA1649 - File name must match first type name (4)
I'm up for renaming to the explicit generic version. I just used the current naming on a whim as I was refactoring the brushes.
- SA1401 - Field must be private (4)
If it's not references anywhere outside the class make it a private field, otherwise a property.
- CS0219 - The variable <> is assigned but its value is never used (4)
If they're not used it's an oversight and the variables should never be assigned.
Of course run the tests to make sure nothing breaks 馃樃
thanks @JimBobSquarePants! 馃槃 makes sense! will see what I can do.
Most helpful comment
I would personally just rename the generic files (and header) to the style StyleCop wants rather than fighting with it.
I.E. Just rename
Brushes`2.cstoBrushes{TColor,TPacked}.cs.