Update contribution guidelines

- Use C# 9 (instead of C# 8)
- Removed Rozlynator and StyleCop analysers
- Update line length to 130
- using directives now go outside namespace
- Enforce US english
- Enforce braces for single statements
- Implicit type where appropriate
This commit is contained in:
Oliver Booth 2021-03-03 21:59:43 +00:00
parent 463a18ee9b
commit 35175807a3
1 changed files with 13 additions and 13 deletions

View File

@ -2,25 +2,25 @@
Contributions to this project are always welcome. If you spot a bug, or want to request a new extension method, open a new issue or submit a pull request. Contributions to this project are always welcome. If you spot a bug, or want to request a new extension method, open a new issue or submit a pull request.
### Pull request guidelines ### Pull request guidelines
This project uses C# 8.0 language features, and adheres to the following analyzers: This project uses C# 9.0 language features, and adheres to the FxCop analyzer.
There is an `.editorconfig` included in this repository. For quick and painless pull requests, ensure that the analyzer does not throw warnings.
- Rozlynator
- FxCop
- StyleCop
There is an `.editorconfig` and an analyzer `ruleset` file included in this repository. For quick and painless pull requests, ensure that these analyzers do not throw warnings.
### Code style ### Code style
Below are a few pointers to which you may refer, but keep in mind this is not an exhaustive list: Below are a few pointers to which you may refer, but keep in mind this is not an exhaustive list:
- Use C# 8.0 features where possible - Use C# 9.0 features where possible
- Try to ensure code is CLS-compliant - Try to ensure code is CLS-compliant. Where this is not possible, decorate methods with `CLSCompliantAttribute` and pass `false`
- Follow all .NET guidelines for naming conventions - Follow all .NET guidelines for naming conventions
- Make full use of XMLDoc and be thorough - but concise - with all documentation. - Make full use of XMLDoc and be thorough - but concise - with all documentation
- Ensure that no line exceeds 120 characters in length - Ensure that no line exceeds 130 characters in length
- Do NOT include file headers in any form - Do NOT include file headers in any form
- Declare `using` directives within namespace scope - Declare `using` directives outside of namespace scope
- Try to avoid using exceptions for flow control - Avoid using exceptions for flow control where possible
- Use braces, even for single-statement bodies
- Use implicit type when the type is apparent or not important
- Use U.S. English throughout the codebase and documentation
When in doubt, follow .NET guidelines for styling.
### Tests ### Tests
When introducing a new extension method, you must ensure that you have also defined a unit test that asserts its correct behavior. The code style guidelines and code-analysis rules apply to the `X10D.Tests` equally as much as `X10D`, although documentation may be briefer. Refer to existing tests as a guideline. When introducing a new extension method, you must ensure that you have also defined a unit test that asserts its correct behavior. The code style guidelines and code-analysis rules apply to the `X10D.Tests` equally as much as `X10D`, although documentation may be briefer. Refer to existing tests as a guideline.