CI: use prebuilt clang-format 18

This commit is contained in:
Arina Neshlyaeva
2024-10-08 09:22:44 -07:00
committed by aneshlya
parent 6c2ba8e277
commit cb912b13a0
3 changed files with 18 additions and 130 deletions
+1 -117
View File
@@ -1,121 +1,5 @@
---
Language: Cpp
# BasedOnStyle: LLVM 8.0
# Changed parametera:
# ColumnLimit: 80 -> 120
# IndentWidth: 2 -> 4
# TabWidth: 2 -> 4
# Removed ObjC-related parameters
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
BasedOnStyle: LLVM
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: false
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Right
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 4
UseTab: Never
...
+11 -6
View File
@@ -7,9 +7,18 @@ permissions: read-all
on: [push, pull_request]
env:
SDE_MIRROR_ID: 813591
SDE_TAR_NAME: sde-external-9.33.0-2024-01-07
USER_AGENT: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
LLVM_REPO: https://github.com/ispc/ispc.dependencies
jobs:
check-format:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
env:
LLVM_VERSION: "18.1"
LLVM_TAR: llvm-18.1.8-ubuntu22.04-Release+Asserts-x86.arm.wasm.tar.xz
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
@@ -18,11 +27,7 @@ jobs:
- name: Install dependencies
run: |
echo "APT::Acquire::Retries \"3\";" | sudo tee -a /etc/apt/apt.conf.d/80-retries
sudo apt-get update
sudo apt-get install -y clang-format-12 clang-12
sudo ln -sf /usr/bin/clang-12 /usr/bin/clang
sudo ln -sf /usr/bin/clang-format-12 /usr/bin/clang-format
.github/workflows/scripts/install-build-deps.sh
- name: Check format
run: |
+3 -4
View File
@@ -7,14 +7,14 @@ EXIT_CODE=0
echo "\
############################################################################
Checking formatting of modified files. It is expected that the files were
formatted with clang-format 12.0.0. It is also expected that clang-format
version 12.0.0 is used for the check. Otherwise the result can ne unexpected.
formatted with clang-format 18.1. It is also expected that clang-format
version 18.1 is used for the check. Otherwise the result can ne unexpected.
############################################################################"
CLANG_FORMAT="clang-format"
[[ ! -z $1 ]] && CLANG_FORMAT=$1
which "$CLANG_FORMAT" || { echo "No $CLANG_FORMAT found in PATH" && exit 1; }
REQUIRED_VERSION="12.0.0"
REQUIRED_VERSION="18.1"
VERSION_STRING="clang-format version $REQUIRED_VERSION.*"
CURRENT_VERSION="$($CLANG_FORMAT --version)"
if ! [[ $CURRENT_VERSION =~ $VERSION_STRING ]] ; then
@@ -27,7 +27,6 @@ fi
FILES=$(ls \
src/*.{cpp,h} \
src/opt/*.{cpp,h} \
*.cpp \
builtins/*{cpp,hpp,c} \
benchmarks/{01,02}*/*{cpp,ispc} \
common/*.h \