Import Linux kernel .clang-format with small modifications
This commit is contained in:
50
.clang-format
Normal file
50
.clang-format
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
BasedOnStyle: LLVM
|
||||||
|
IndentWidth: 8
|
||||||
|
UseTab: Always
|
||||||
|
BreakBeforeBraces: Linux
|
||||||
|
AllowShortIfStatementsOnASingleLine: false
|
||||||
|
IndentCaseLabels: false
|
||||||
|
AlwaysBreakAfterReturnType: All
|
||||||
|
Cpp11BracedListStyle: false
|
||||||
|
ColumnLimit: 80
|
||||||
|
AlignAfterOpenBracket: Align
|
||||||
|
AlignConsecutiveDeclarations: true
|
||||||
|
AlwaysBreakBeforeMultilineStrings: false
|
||||||
|
BreakBeforeBinaryOperators: None
|
||||||
|
BreakBeforeTernaryOperators: true
|
||||||
|
AlignEscapedNewlines: Left
|
||||||
|
DerivePointerAlignment: false
|
||||||
|
PointerAlignment: Right
|
||||||
|
IncludeBlocks: Regroup
|
||||||
|
IncludeCategories:
|
||||||
|
- Regex: '^<isc/'
|
||||||
|
Priority: 2
|
||||||
|
- Regex: '^<dns/'
|
||||||
|
Priority: 3
|
||||||
|
- Regex: '^<iscccc/'
|
||||||
|
Priority: 4
|
||||||
|
- Regex: '^<isccfg/'
|
||||||
|
Priority: 5
|
||||||
|
- Regex: '^<ns/'
|
||||||
|
Priority: 6
|
||||||
|
- Regex: '^<bind9/)'
|
||||||
|
Priority: 7
|
||||||
|
- Regex: '^(<[^/]*)/)'
|
||||||
|
Priority: 8
|
||||||
|
- Regex: '<[[:alnum:].]+>'
|
||||||
|
Priority: 1
|
||||||
|
- Regex: '".*"'
|
||||||
|
Priority: 9
|
||||||
|
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||||
|
|
||||||
|
# Taken from git's rules
|
||||||
|
PenaltyBreakAssignment: 10
|
||||||
|
# PenaltyBreakBeforeFirstCallParameter: 30
|
||||||
|
PenaltyBreakComment: 10
|
||||||
|
PenaltyBreakFirstLessLess: 0
|
||||||
|
PenaltyBreakString: 10
|
||||||
|
PenaltyExcessCharacter: 100
|
||||||
|
|
||||||
|
Standard: Cpp11
|
||||||
|
|
||||||
|
ContinuationIndentWidth: 8
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
|
./.clang-format X 2019,2020
|
||||||
./.gitlab-ci.yml X 2018,2019,2020
|
./.gitlab-ci.yml X 2018,2019,2020
|
||||||
./.uncrustify.cfg X 2018,2019,2020
|
./.uncrustify.cfg X 2018,2019,2020
|
||||||
./CHANGES X 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020
|
./CHANGES X 2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020
|
||||||
|
|||||||
@@ -521,10 +521,10 @@ foreach $file (keys %file_types) {
|
|||||||
# Process leading white space.
|
# Process leading white space.
|
||||||
# Remove 1-7 spaces followed by a tab into a single
|
# Remove 1-7 spaces followed by a tab into a single
|
||||||
# tab if at start of line or proceeded by tabs.
|
# tab if at start of line or proceeded by tabs.
|
||||||
s/^(\t*) {1,7}\t/$1\t/ while (/^\t* {1,7}\t/);
|
# s/^(\t*) {1,7}\t/$1\t/ while (/^\t* {1,7}\t/);
|
||||||
# Convert 8 spaces into tabs if at start of line
|
# Convert 8 spaces into tabs if at start of line
|
||||||
# or preceeded by tabs.
|
# or preceeded by tabs.
|
||||||
s/^(\t*) {8}/$1\t/ while (/^\t* {8}/);
|
# s/^(\t*) {8}/$1\t/ while (/^\t* {8}/);
|
||||||
# Remove trailing white space.
|
# Remove trailing white space.
|
||||||
s/[ \t]*$//;
|
s/[ \t]*$//;
|
||||||
$body = "$body$_";
|
$body = "$body$_";
|
||||||
|
|||||||
Reference in New Issue
Block a user