Skip to content

Commit 3ceb17e

Browse files
Linting: Upgrade to latest version of yscope-dev-utils and add C++ lint configs from yscope-dev-utils. (#537)
1 parent 8ea88fc commit 3ceb17e

File tree

4 files changed

+12
-153
lines changed

4 files changed

+12
-153
lines changed

components/core/.clang-format

Lines changed: 2 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,5 @@
1-
# yamllint disable-line rule:document-start
2-
---
3-
ColumnLimit: 100
4-
IndentWidth: 4
5-
# yamllint disable-line rule:document-start
6-
---
7-
Language: "Cpp"
8-
AccessModifierOffset: -4
9-
AlignAfterOpenBracket: "BlockIndent"
10-
AlignArrayOfStructures: "None"
11-
AlignConsecutiveAssignments: "None"
12-
AlignConsecutiveBitFields: "None"
13-
AlignConsecutiveDeclarations: "None"
14-
AlignConsecutiveMacros: "None"
15-
AlignEscapedNewlines: "DontAlign"
16-
AlignOperands: "Align"
17-
AlignTrailingComments:
18-
Kind: "Never"
19-
AllowAllArgumentsOnNextLine: false
20-
AllowAllParametersOfDeclarationOnNextLine: false
21-
AllowBreakBeforeNoexceptSpecifier: "OnlyWithParen"
22-
AllowShortBlocksOnASingleLine: "Always"
23-
AllowShortCaseLabelsOnASingleLine: false
24-
AllowShortCompoundRequirementOnASingleLine: true
25-
AllowShortEnumsOnASingleLine: false
26-
AllowShortFunctionsOnASingleLine: "Inline"
27-
AllowShortIfStatementsOnASingleLine: "Never"
28-
AllowShortLambdasOnASingleLine: "All"
29-
AllowShortLoopsOnASingleLine: false
30-
AlwaysBreakAfterReturnType: "None"
31-
AlwaysBreakBeforeMultilineStrings: false
32-
AlwaysBreakTemplateDeclarations: "Yes"
33-
BinPackArguments: false
34-
BinPackParameters: false
35-
BitFieldColonSpacing: "Both"
36-
BraceWrapping:
37-
AfterCaseLabel: false
38-
AfterClass: false
39-
AfterControlStatement: "MultiLine"
40-
AfterEnum: false
41-
AfterFunction: false
42-
AfterNamespace: false
43-
AfterExternBlock: false
44-
AfterStruct: false
45-
AfterUnion: false
46-
BeforeCatch: false
47-
BeforeElse: false
48-
BeforeLambdaBody: false
49-
BeforeWhile: false
50-
IndentBraces: false
51-
SplitEmptyFunction: false
52-
SplitEmptyNamespace: false
53-
SplitEmptyRecord: false
54-
BreakAfterAttributes: "Never"
55-
BreakBeforeBinaryOperators: "All"
56-
BreakBeforeBraces: "Custom"
57-
BreakBeforeConceptDeclarations: "Always"
58-
BreakBeforeInlineASMColon: "OnlyMultiline"
59-
BreakBeforeTernaryOperators: true
60-
BreakConstructorInitializers: "BeforeColon"
61-
BreakInheritanceList: "BeforeColon"
62-
BreakStringLiterals: true
63-
CompactNamespaces: true
64-
ConstructorInitializerIndentWidth: 8
65-
ContinuationIndentWidth: 8
66-
Cpp11BracedListStyle: true
67-
DerivePointerAlignment: false
68-
DisableFormat: false
69-
EmptyLineAfterAccessModifier: "Never"
70-
EmptyLineBeforeAccessModifier: "LogicalBlock"
71-
FixNamespaceComments: true
72-
IncludeBlocks: "Regroup"
1+
BasedOnStyle: "InheritParentConfig"
2+
733
IncludeCategories:
744
# NOTE: A header is grouped by first matching regex
755
# Library headers. Update when adding new libraries.
@@ -86,80 +16,3 @@ IncludeCategories:
8616
# Project headers
8717
- Regex: "^\".+\""
8818
Priority: 4
89-
IndentAccessModifiers: false
90-
IndentCaseBlocks: false
91-
IndentCaseLabels: true
92-
IndentExternBlock: "Indent"
93-
IndentGotoLabels: false
94-
IndentPPDirectives: "BeforeHash"
95-
IndentRequiresClause: false
96-
IndentWrappedFunctionNames: false
97-
InsertBraces: true
98-
InsertNewlineAtEOF: true
99-
IntegerLiteralSeparator:
100-
Binary: 4
101-
BinaryMinDigits: 4
102-
Decimal: 3
103-
DecimalMinDigits: 5
104-
Hex: 4
105-
HexMinDigits: 4
106-
KeepEmptyLinesAtTheStartOfBlocks: false
107-
LambdaBodyIndentation: "Signature"
108-
LineEnding: "LF"
109-
MaxEmptyLinesToKeep: 1
110-
NamespaceIndentation: "None"
111-
PPIndentWidth: -1
112-
PackConstructorInitializers: "CurrentLine"
113-
PenaltyBreakOpenParenthesis: 25
114-
PenaltyBreakBeforeFirstCallParameter: 25
115-
PenaltyReturnTypeOnItsOwnLine: 100
116-
PointerAlignment: "Left"
117-
QualifierAlignment: "Custom"
118-
QualifierOrder:
119-
- "static"
120-
- "friend"
121-
- "inline"
122-
# constexpr west as explained in https://www.youtube.com/watch?v=z6s6bacI424
123-
- "constexpr"
124-
- "type"
125-
- "const"
126-
- "volatile"
127-
ReferenceAlignment: "Pointer"
128-
ReflowComments: true
129-
RemoveBracesLLVM: false
130-
RemoveSemicolon: true
131-
RequiresClausePosition: "OwnLine"
132-
RequiresExpressionIndentation: "OuterScope"
133-
SeparateDefinitionBlocks: "Always"
134-
ShortNamespaceLines: 0
135-
SortIncludes: "CaseInsensitive"
136-
SortUsingDeclarations: "Lexicographic"
137-
SpaceAfterCStyleCast: false
138-
SpaceAfterLogicalNot: false
139-
SpaceAfterTemplateKeyword: true
140-
SpaceAroundPointerQualifiers: "Default"
141-
SpaceBeforeAssignmentOperators: true
142-
SpaceBeforeCaseColon: false
143-
SpaceBeforeCpp11BracedList: false
144-
SpaceBeforeCtorInitializerColon: true
145-
SpaceBeforeInheritanceColon: true
146-
SpaceBeforeParens: "ControlStatements"
147-
SpaceBeforeRangeBasedForLoopColon: true
148-
SpaceBeforeSquareBrackets: false
149-
SpaceInEmptyBlock: false
150-
SpacesBeforeTrailingComments: 2
151-
SpacesInAngles: false
152-
SpacesInContainerLiterals: false
153-
SpacesInLineCommentPrefix:
154-
Minimum: 1
155-
Maximum: -1
156-
SpacesInParens: "Custom"
157-
SpacesInParensOptions:
158-
InConditionalStatements: false
159-
InCStyleCasts: false
160-
InEmptyParentheses: false
161-
Other: false
162-
SpacesInSquareBrackets: false
163-
Standard: "Latest"
164-
TabWidth: 4
165-
UseTab: "Never"

lint-tasks.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ tasks:
2121

2222
cpp-check:
2323
sources: &cpp_source_files
24+
- "{{.ROOT_DIR}}/.clang-format"
25+
- "{{.ROOT_DIR}}/.clang-tidy"
2426
- "{{.TASKFILE}}"
2527
- ".clang-format"
2628
- "src/**/*.cpp"
@@ -119,7 +121,7 @@ tasks:
119121
requires:
120122
vars: ["FLAGS"]
121123
dir: "components/core"
122-
deps: ["venv"]
124+
deps: ["cpp-lint-configs", "venv"]
123125
cmds:
124126
- |-
125127
. "{{.G_LINT_VENV_DIR}}/bin/activate"
@@ -129,6 +131,10 @@ tasks:
129131
-print0 | \
130132
xargs -0 clang-format {{.FLAGS}} -Werror
131133
134+
cpp-lint-configs:
135+
internal: true
136+
cmd: "{{.ROOT_DIR}}/tools/yscope-dev-utils/lint-configs/symlink-cpp-lint-configs.sh"
137+
132138
js:
133139
internal: true
134140
requires:

tools/scripts/deps-download/init.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ project_root_dir="$script_dir/../../../"
1111
download_dep_script="$script_dir/download-dep.py"
1212

1313
python3 "${download_dep_script}" \
14-
https://github.com/y-scope/yscope-dev-utils/archive/ff1611e6.zip \
15-
yscope-dev-utils-ff1611e6f9b116da27dc7f8f71797829c22d0b1a \
14+
https://github.com/y-scope/yscope-dev-utils/archive/2caa3dcf.zip \
15+
yscope-dev-utils-2caa3dcfbbccff052d179e643a509d8ad05bc217 \
1616
"${project_root_dir}/tools/yscope-dev-utils" \
1717
--extract

0 commit comments

Comments
 (0)