mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-08 11:37:04 +09:00
Coding style inconsistency: namespace imports - Fix (dotnet/corefx#32975)
* Coding style inconsistency: namespace imports - Fix
A fix for the issues mentioned in [dotnet/corefx#32277](https://github.com/dotnet/corefx/issues/32277) regarding the sorting of `System.*` namespaces.
@danmosemsft
* Tweaking description of vssettings and spelling
Removed unnecessary version-specific language regarding VS (and .vssettings) and correcting an (unrelated) spelling mistake
Commit migrated from 7866452ae2
This commit is contained in:
parent
c6e263b1bf
commit
dc0fce682e
1 changed files with 4 additions and 2 deletions
|
@ -15,7 +15,7 @@ The general rule we follow is "use Visual Studio defaults".
|
|||
`private string _foo` not `string _foo`). Visibility should be the first modifier (e.g.
|
||||
`public abstract` not `abstract public`).
|
||||
6. Namespace imports should be specified at the top of the file, *outside* of
|
||||
`namespace` declarations, and should be sorted alphabetically.
|
||||
`namespace` declarations, and should be sorted alphabetically, with the exception of `System.*` namespaces, which are to be placed on top of all others.
|
||||
7. Avoid more than one empty line at any time. For example, do not have two
|
||||
blank lines between members of a type.
|
||||
8. Avoid spurious free spaces.
|
||||
|
@ -31,7 +31,9 @@ The general rule we follow is "use Visual Studio defaults".
|
|||
15. When including non-ASCII characters in the source code use Unicode escape sequences (\uXXXX) instead of literal characters. Literal non-ASCII characters occasionally get garbled by a tool or editor.
|
||||
16. When using labels (for goto), indent the label one less than the current indentation.
|
||||
|
||||
We have provided a Visual Studio 2013 vssettings file (`corefx.vssettings`) at the root of the corefx repository, enabling C# auto-formatting conforming to the above guidelines. Note that rules 7 and 8 are not covered by the vssettings, since these are not rules currently supported by VS formatting.
|
||||
We have provided a Visual Studio vssettings file (`corefx.vssettings`) at the root of the corefx repository, enabling C# auto-formatting conforming to the above guidelines. Note that rules 7 and 8 are not covered by the vssettings, since these are not rules currently supported by VS formatting.
|
||||
|
||||
Additionally for auto-formatting in non-Visual Studio editors, an [EditorConfig](https://editorconfig.org "EditorConfig homepage") file (`.editorconfig`) has also been provided at the root of the corefx repository.
|
||||
|
||||
We also use the [.NET Codeformatter Tool](https://github.com/dotnet/codeformatter) to ensure the code base maintains a consistent style over time, the tool automatically fixes the code base to conform to the guidelines outlined above.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue