aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorphunkyfish <phunkyfish@gmail.com>2019-10-04 16:00:13 +0100
committerphunkyfish <phunkyfish@gmail.com>2019-10-06 09:10:26 +0100
commitcf7b0bb5b6129889a70f8916c24933062adc9ec8 (patch)
tree2a668554303233785c5f355fdb664ab8c38c59ea
parentd0dd36c61ed2613af812e1b6b40480c83927442f (diff)
[clang-format] switch - indent case and default
-rw-r--r--.clang-format2
-rw-r--r--docs/CODE_GUIDELINES.md23
2 files changed, 11 insertions, 14 deletions
diff --git a/.clang-format b/.clang-format
index 02f730e6d6..c70b27c2af 100644
--- a/.clang-format
+++ b/.clang-format
@@ -51,7 +51,7 @@ IncludeCategories:
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '$'
-IndentCaseLabels: false
+IndentCaseLabels: true
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
diff --git a/docs/CODE_GUIDELINES.md b/docs/CODE_GUIDELINES.md
index 07c12991fe..e66b8a3989 100644
--- a/docs/CODE_GUIDELINES.md
+++ b/docs/CODE_GUIDELINES.md
@@ -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
@@ -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();
}
```