Skip to content

Commit

Permalink
Move init.sh one level up; Add step to symlink cpp-lint configs from …
Browse files Browse the repository at this point in the history
…yscope-dev-utils; Replace core's .clang-format with one that only sets IncludeCategories.
  • Loading branch information
kirkrodrigues committed Sep 4, 2024
1 parent 8929026 commit b7c6cd5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 155 deletions.
2 changes: 1 addition & 1 deletion .github/actions/clp-core-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ runs:
fi
shell: "bash"

- run: "./tools/scripts/deps-download/init.sh"
- run: "./tools/scripts/init.sh"
shell: "bash"

- run: >-
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clp-core-build-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: "Install dependencies"
run: "./components/core/tools/scripts/lib_install/macos-12/install-all.sh"

- run: "./tools/scripts/deps-download/init.sh"
- run: "./tools/scripts/init.sh"
shell: "bash"

- run: "task deps:core"
Expand Down
151 changes: 2 additions & 149 deletions components/core/.clang-format
Original file line number Diff line number Diff line change
@@ -1,75 +1,5 @@
# yamllint disable-line rule:document-start
---
ColumnLimit: 100
IndentWidth: 4
# yamllint disable-line rule:document-start
---
Language: "Cpp"
AccessModifierOffset: -4
AlignAfterOpenBracket: "BlockIndent"
AlignArrayOfStructures: "None"
AlignConsecutiveAssignments: "None"
AlignConsecutiveBitFields: "None"
AlignConsecutiveDeclarations: "None"
AlignConsecutiveMacros: "None"
AlignEscapedNewlines: "DontAlign"
AlignOperands: "Align"
AlignTrailingComments:
Kind: "Never"
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowBreakBeforeNoexceptSpecifier: "OnlyWithParen"
AllowShortBlocksOnASingleLine: "Always"
AllowShortCaseLabelsOnASingleLine: false
AllowShortCompoundRequirementOnASingleLine: true
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: "Inline"
AllowShortIfStatementsOnASingleLine: "Never"
AllowShortLambdasOnASingleLine: "All"
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: "None"
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: "Yes"
BinPackArguments: false
BinPackParameters: false
BitFieldColonSpacing: "Both"
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: "MultiLine"
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterExternBlock: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyNamespace: false
SplitEmptyRecord: false
BreakAfterAttributes: "Never"
BreakBeforeBinaryOperators: "All"
BreakBeforeBraces: "Custom"
BreakBeforeConceptDeclarations: "Always"
BreakBeforeInlineASMColon: "OnlyMultiline"
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: "BeforeColon"
BreakInheritanceList: "BeforeColon"
BreakStringLiterals: true
CompactNamespaces: true
ConstructorInitializerIndentWidth: 8
ContinuationIndentWidth: 8
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: "Never"
EmptyLineBeforeAccessModifier: "LogicalBlock"
FixNamespaceComments: true
IncludeBlocks: "Regroup"
BasedOnStyle: "InheritParentConfig"

IncludeCategories:
# NOTE: A header is grouped by first matching regex
# Library headers. Update when adding new libraries.
Expand All @@ -86,80 +16,3 @@ IncludeCategories:
# Project headers
- Regex: "^\".+\""
Priority: 4
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: "Indent"
IndentGotoLabels: false
IndentPPDirectives: "BeforeHash"
IndentRequiresClause: false
IndentWrappedFunctionNames: false
InsertBraces: true
InsertNewlineAtEOF: true
IntegerLiteralSeparator:
Binary: 4
BinaryMinDigits: 4
Decimal: 3
DecimalMinDigits: 5
Hex: 4
HexMinDigits: 4
KeepEmptyLinesAtTheStartOfBlocks: false
LambdaBodyIndentation: "Signature"
LineEnding: "LF"
MaxEmptyLinesToKeep: 1
NamespaceIndentation: "None"
PPIndentWidth: -1
PackConstructorInitializers: "CurrentLine"
PenaltyBreakOpenParenthesis: 25
PenaltyBreakBeforeFirstCallParameter: 25
PenaltyReturnTypeOnItsOwnLine: 100
PointerAlignment: "Left"
QualifierAlignment: "Custom"
QualifierOrder:
- "static"
- "friend"
- "inline"
# constexpr west as explained in https://www.youtube.com/watch?v=z6s6bacI424
- "constexpr"
- "type"
- "const"
- "volatile"
ReferenceAlignment: "Pointer"
ReflowComments: true
RemoveBracesLLVM: false
RemoveSemicolon: true
RequiresClausePosition: "OwnLine"
RequiresExpressionIndentation: "OuterScope"
SeparateDefinitionBlocks: "Always"
ShortNamespaceLines: 0
SortIncludes: "CaseInsensitive"
SortUsingDeclarations: "Lexicographic"
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAroundPointerQualifiers: "Default"
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: "ControlStatements"
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParens: "Custom"
SpacesInParensOptions:
InConditionalStatements: false
InCStyleCasts: false
InEmptyParentheses: false
Other: false
SpacesInSquareBrackets: false
Standard: "Latest"
TabWidth: 4
UseTab: "Never"
2 changes: 1 addition & 1 deletion docs/src/dev-guide/building-package.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ prebuilt version instead, check out the [releases](https://github.com/y-scope/cl
Initialize the project

```shell
tools/scripts/deps-download/init.sh
tools/scripts/init.sh
```

Install CLP core's dependencies
Expand Down
2 changes: 1 addition & 1 deletion docs/src/dev-guide/components-core/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ from source.
To initialize the project, run:

```shell
tools/scripts/deps-download/init.sh
tools/scripts/init.sh
```

### Source Dependencies
Expand Down
6 changes: 4 additions & 2 deletions tools/scripts/deps-download/init.sh → tools/scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ set -e
set -u

script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
project_root_dir="$script_dir/../../../"
download_dep_script="$script_dir/download-dep.py"
project_root_dir="$script_dir/../../"
download_dep_script="$script_dir/deps-download/download-dep.py"

python3 "${download_dep_script}" \
https://github.com/y-scope/yscope-dev-utils/archive/536af8e5.zip \
yscope-dev-utils-536af8e5e8a779f447b994723e46431845c030d8 \
"${project_root_dir}/tools/yscope-dev-utils" \
--extract

./tools/yscope-dev-utils/lint-configs/symlink-cpp-lint-configs.sh

0 comments on commit b7c6cd5

Please sign in to comment.