mirror of
https://github.com/VSadov/Satori.git
synced 2025-06-08 03:27:04 +09:00
Update coding-style.md (#67801)
* Remove mention of outdated formatting script and C++ language that was removed from libraries. * Move C# coding style at the top of document.
This commit is contained in:
parent
c38f006577
commit
1094cee781
1 changed files with 2 additions and 4 deletions
|
@ -1,10 +1,6 @@
|
|||
C# Coding Style
|
||||
===============
|
||||
|
||||
For C++ files (*.cpp and *.h), we use clang-format (version 3.8) to ensure code styling. After changing any Cpp or H file and before merging, src/Native/format-code.sh must be run. This script will ensure that all native code files adhere to the coding style guidelines.
|
||||
|
||||
For other types of files (xml, bat, sh, etc), our current best guidance is consistency. When editing files, keep new code and changes consistent with the style in the files. For new files, it should conform to the style for that component. If there is a completely new component, anything that is reasonably broadly accepted is fine. For script files, please refer to the scripting blog for [tips](https://devblogs.microsoft.com/scripting/tag/powertip) and [best practices](https://devblogs.microsoft.com/scripting/tag/best-practices).
|
||||
|
||||
The general rule we follow is "use Visual Studio defaults".
|
||||
|
||||
1. We use [Allman style](http://en.wikipedia.org/wiki/Indent_style#Allman_style) braces, where each brace begins on a new line. A single line statement block can go without braces but the block must be properly indented on its own line and must not be nested in other statement blocks that use braces (See rule 18 for more details). One exception is that a `using` statement is permitted to be nested within another `using` statement by starting on the following line at the same indentation level, even if the nested `using` contains a controlled block.
|
||||
|
@ -138,3 +134,5 @@ namespace System.Collections.Generics
|
|||
}
|
||||
}
|
||||
```
|
||||
|
||||
For other languages, our current best guidance is consistency. When editing files, keep new code and changes consistent with the style in the files. For new files, it should conform to the style for that component. If there is a completely new component, anything that is reasonably broadly accepted is fine. For script files, please refer to the scripting blog for [tips](https://devblogs.microsoft.com/scripting/tag/powertip) and [best practices](https://devblogs.microsoft.com/scripting/tag/best-practices).
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue