Skip to content

Commit

Permalink
[clang-format] switch - indent case and default
Browse files Browse the repository at this point in the history
  • Loading branch information
phunkyfish committed Oct 6, 2019
1 parent d0dd36c commit cf7b0bb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Expand Up @@ -51,7 +51,7 @@ IncludeCategories:
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
Expand Down
23 changes: 10 additions & 13 deletions docs/CODE_GUIDELINES.md
Expand Up @@ -120,8 +120,6 @@ public:
}
```
**Exception:** Do not increase indentation after a `switch` statements.
### 3.3. Control statements
Insert a new line before every:
* else in an if statement
Expand All @@ -148,21 +146,20 @@ else
```

#### 3.3.2. switch case
Do not indent `case` and `default`.

```cpp
switch (cmd)
{
case x:
{
doSomething();
break;
}
case x:
case z:
return true;
default:
doSomething();
case x:
{
doSomething();
break;
}
case x:
case z:
return true;
default:
doSomething();
}
```

Expand Down

0 comments on commit cf7b0bb

Please sign in to comment.