Skip to content

Commit 59ec53e

Browse files
Adds scripting guide doc (dotnet#34539)
Scripting guide for Shell, PowerShell and CMD files for styling or other guidance. Fixes dotnet#9317
1 parent e253ff3 commit 59ec53e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/coding-guidelines/coding-style.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ C# Coding Style
33

44
For C++ files (*.cpp and *.h), we use clang-format (version 3.6+) 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.
55

6-
For non code files (xml, 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.
6+
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).
77

88
The general rule we follow is "use Visual Studio defaults".
99

1010
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 17 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.
1111
2. We use four spaces of indentation (no tabs).
1212
3. We use `_camelCase` for internal and private fields and use `readonly` where possible. Prefix internal and private instance fields with `_`, static fields with `s_` and thread static fields with `t_`. When used on static fields, `readonly` should come after `static` (e.g. `static readonly` not `readonly static`). Public fields should be used sparingly and should use PascalCasing with no prefix when used.
13-
4. We avoid `this.` unless absolutely necessary.
13+
4. We avoid `this.` unless absolutely necessary.
1414
5. We always specify the visibility, even if it's the default (e.g.
15-
`private string _foo` not `string _foo`). Visibility should be the first modifier (e.g.
15+
`private string _foo` not `string _foo`). Visibility should be the first modifier (e.g.
1616
`public abstract` not `abstract public`).
1717
6. Namespace imports should be specified at the top of the file, *outside* of
1818
`namespace` declarations, and should be sorted alphabetically, with the exception of `System.*` namespaces, which are to be placed on top of all others.
@@ -77,7 +77,7 @@ namespace System.Collections.Generic
7777
get { return _count; }
7878
}
7979

80-
public ObservableLinkedListNode AddLast(T value)
80+
public ObservableLinkedListNode AddLast(T value)
8181
{
8282
var newNode = new LinkedListNode<T>(this, value);
8383

@@ -97,7 +97,7 @@ namespace System.Collections.Generic
9797
{
9898
...
9999
}
100-
100+
101101
...
102102
}
103103
}

0 commit comments

Comments
 (0)