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

Make StyleCop & al. happier #21

Open
wants to merge 17 commits into
base: master
Choose a base branch
from

Conversation

gregoryruiz
Copy link

👋
Multiple cosmetic proposals:

  • fix some StyleCop readability rules (SA11??), disable others if necessary (including R#er ones)
  • fix some StyleCop naming rules (SA13??), disable others if necessary (including R#er ones)
  • fix some StyleCop maintainability rules (SA14??)
  • fix some StyleCop layout rules (SA15??)
  • fix some StyleCop documentation rules (SA16??), disable others if necessary
  • remove unused directives
  • standardize ut framework usage (NFluent everywhere) & ut classes names (FooTests)
  • match class files to their namespaces
  • remove unnecessary code pieces (var declarations, extraneous '()', ...)
  • refactor WildcardPatternMatcher logic

- use NFluent 'CheckThat...' instead of 'Assert', as the tests majority do
- [StyleCop Rule: SA1503] The body of the if statement must be wrapped in opening and closing curly brackets.
- [StyleCop Rule: SA1505] An opening curly bracket must not be followed by a blank line.
- [StyleCop Rule: SA1507] The code must not contain multiple blank lines in a row.
- [StyleCop Rule: SA1508] A closing curly bracket must not be preceded by a blank line.
- [StyleCop Rule: SA1513] Statements or elements wrapped in curly brackets must be followed by a blank line.
- [StyleCop Rule: SA1515] A single-line comment must be preceded by a blank line or another single-line comment, or must be the first item in its scope.
- [StyleCop Rule: SA1516] Adjacent elements must be separated by a blank line.
- [StyleCop Rule: SA1517] The code must not contain blank lines at the start of the file.
- Test class names should end with 'Tests'
- [StyleCop Rule: SA1600] The class must have a documentation header.
- [StyleCop Rule: SA1644] The documentation header must not contain blank lines. Use the 'para' tag to insert line breaks within documentation text.
- [StyleCop Rule: SA1615] The documentation header must contain a returns tag since the element has a return value.

disabled as unknown copyright and company:
- [StyleCop Rule: SA1633] The file has no header, the header Xml is invalid, or the header is not located at the top of the file.
- [StyleCop Rule: SA1634] The file header must contain a copyright tag.

disabled in tests classes:
- [StyleCop Rule: SA1600] The class must have a documentation header.
disabled as conflicts with internal naming rules:
- [StyleCop Rule: SA1309] Field names must not begin with underscore.
- ReSharper InconsistentNaming
- [StyleCop Rule: SA1111] The closing parenthesis or bracket must be placed on the same line as the last parameter in the parameter list.
- [StyleCop Rule: SA1113] The comma must be placed on the same line as the previous parameter.
- [StyleCop Rule: SA1115] The parameter must begin on the line after the previous parameter.
- [StyleCop Rule: SA1116] If the method parameters are on separate lines, the first parameter must begin on the line beneath the name of the method.
- [StyleCop Rule: SA1121] Use the built-in type alias 'string' rather than String or System.String.
- [StyleCop Rule: SA1121] Use the built-in type alias 'char' rather than Char or System.Char.
- [StyleCop Rule: SA1122] Use string.Empty rather than "".

disabled as it conflicts with internal naming rules:
- [StyleCop Rule: SA1101] The call to _XXX must begin with the 'this.' prefix to indicate that the item is a member of the class.
- [StyleCop Rule: SA1126] The call to _XXX must begin with the 'this.', 'base.', 'object.' or 'YYY' prefix to indicate the intended method call.
- ReSharper ArrangeThisQualifier
- string.Compare is culture specific, replace it with string.CompareOrdinal
- "clarify" reading
- [StyleCop Rule: SA1201] All properties must be placed after all fields.
- [StyleCop Rule: SA1201] All properties must be placed after all interfaces.
- [StyleCop Rule: SA1201] All methods must be placed after all properties.
- [StyleCop Rule: SA1202] All private fields must be placed after all public fields.
- [StyleCop Rule: SA1202] All private methods must be placed after all public methods.
- [StyleCop Rule: SA1204] All static public methods must be placed before all non-static public methods.
- [StyleCop Rule: SA1206] The 'static' keyword must come before the 'other' keyword in the element declaration.
- [StyleCop Rule: SA1400] The class must have an access modifier.
- [StyleCop Rule: SA1401] Fields must be declared with private access. Use properties to expose fields.
- [StyleCop Rule: SA1650] The documentation text within the remarks tag contains incorrectly spelled words: XXX
- move "using ..." after namespaces declaration
- so we are not tempted to use c#6 syntactic sugars / features
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.

1 participant