diff --git a/.github/workflows/clang/pr-check-trailing-whitespace.yml b/.github/workflows/clang/pr-check-trailing-whitespace.yml new file mode 100644 index 0000000000000..b08f1e24d785a --- /dev/null +++ b/.github/workflows/clang/pr-check-trailing-whitespace.yml @@ -0,0 +1,14 @@ +name: Ensure there are no trailing whitespace + +on: + pull_request: + paths: + - 'clang/**' + +jobs: + example: + name: Find Trailing Whitespace + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: harupy/find-trailing-whitespace@master diff --git a/.github/workflows/clang/pr-clang-format.yml b/.github/workflows/clang/pr-clang-format.yml new file mode 100644 index 0000000000000..2589b815a480f --- /dev/null +++ b/.github/workflows/clang/pr-clang-format.yml @@ -0,0 +1,18 @@ +name: clang-format Check + +on: + pull_request: + paths: + - 'clang/**' + +jobs: + formatting-check: + name: Formatting Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Run clang-format style check + uses: jidicula/clang-format-action@v4.11.0 + with: + clang-format-version: '16' + check-path: 'clang/' diff --git a/clang/lib/AST/Expr.cpp b/clang/lib/AST/Expr.cpp index 4f3837371b3fc..342a7e3e47144 100644 --- a/clang/lib/AST/Expr.cpp +++ b/clang/lib/AST/Expr.cpp @@ -63,7 +63,7 @@ const Expr *Expr::getBestDynamicClassTypeExpr() const { } return E; -} +} const CXXRecordDecl *Expr::getBestDynamicClassType() const { const Expr *E = getBestDynamicClassTypeExpr(); diff --git a/clang/lib/AST/ExprClassification.cpp b/clang/lib/AST/ExprClassification.cpp index 12193b7812f9b..18d35d1d47cfb 100644 --- a/clang/lib/AST/ExprClassification.cpp +++ b/clang/lib/AST/ExprClassification.cpp @@ -79,6 +79,12 @@ Cl Expr::ClassifyImpl(ASTContext &Ctx, SourceLocation *Loc) const { return Classification(kind, modifiable); } +static int not_well_formatted_code(int i) +{ + int hi = i ; + return hi; +} + /// Classify an expression which creates a temporary, based on its type. static Cl::Kinds ClassifyTemporary(QualType T) { if (T->isRecordType()) diff --git a/clang/utils/ci/buildkite-pipeline.yml b/clang/utils/ci/buildkite-pipeline.yml index 7a679176038c6..22ee165d1edf4 100644 --- a/clang/utils/ci/buildkite-pipeline.yml +++ b/clang/utils/ci/buildkite-pipeline.yml @@ -17,17 +17,6 @@ env: # LLVM RELEASE bump version LLVM_HEAD_VERSION: "17" steps: - - label: "Format" - commands: - - "clang/utils/ci/run-buildbot check-format" - agents: - queue: "linux" - retry: - automatic: - - exit_status: -1 # Agent was lost - limit: 2 - timeout_in_minutes: 120 - - label: "Building and testing clang (Linux)" commands: - "clang/utils/ci/run-buildbot build-clang" diff --git a/clang/utils/ci/run-buildbot b/clang/utils/ci/run-buildbot index d117fccc7e3fb..56a1a9a8c8cfa 100755 --- a/clang/utils/ci/run-buildbot +++ b/clang/utils/ci/run-buildbot @@ -69,9 +69,6 @@ cmake --version ninja --version case "${BUILDER}" in -check-format) - ! grep -rnI '[[:blank:]]$' clang/lib clang/include clang/docs -;; build-clang) mkdir install # We use Release here to avoid including debug information. Otherwise, the