[llvm] [Github] Make PR formatting job only run with C/C++ changes (PR #69556)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 18 20:36:33 PDT 2023


https://github.com/boomanaiden154 created https://github.com/llvm/llvm-project/pull/69556

Currently the PR formatting job only runs clang-format. There isn't a lot of utility in running it if there aren't any C/C++ changes as there will be nothing to format. This isn't super noisy currently as the job doesn't fail if there aren't any C/C++ changes, but it's a bit of a waste.

In addition, this patch names the code formatting job "Check C++ Formatting" to make it clear that this job only checks C/C++ formatting rather than Python formatting/other languages.

>From 764bd0cd072da747dda62df36d3d718dac617631 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <agrossman154 at yahoo.com>
Date: Wed, 18 Oct 2023 20:23:40 -0700
Subject: [PATCH] [Github] Make PR formatting job only run with C/C++ changes

Currently the PR formatting job only runs clang-format. There isn't a
lot of utility in running it if there aren't any C/C++ changes as there
will be nothing to format. This isn't super noisy currently as the job doesn't
fail if there aren't any C/C++ changes, but it's a bit of a waste.

In addition, this patch names the code formatting job "Check C++
Formatting" to make it clear that this job only checks C/C++ formatting
rather than Python formatting/other languages.
---
 .github/workflows/pr-code-format.yml | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/pr-code-format.yml b/.github/workflows/pr-code-format.yml
index 3a91ffb0b1ad9a7..060646df6ae4759 100644
--- a/.github/workflows/pr-code-format.yml
+++ b/.github/workflows/pr-code-format.yml
@@ -1,10 +1,19 @@
 name: "Check code formatting"
-on: pull_request_target
+
+on:
+  pull_request_target:
+    paths:
+      - '**/*.cpp'
+      - '**/*.c'
+      - '**/*.h'
+      - '**/*.inc'
+
 permissions:
   pull-requests: write
 
 jobs:
-  code_formatter:
+  cpp_code_formatter:
+    name: "Check C++ Formatting"
     runs-on: ubuntu-latest
     steps:
       - name: Fetch LLVM sources



More information about the llvm-commits mailing list