Skip to contentSkip to conversation

clang-format: add check-format workflow, update CONTRIBUTING.md

PATCH Superseded Rahul Sandhu 3 participants 5 messages Oct 25, 2025 – Oct 28, 2025 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 clang-format: add check-format workflow, update CONTRIBUTING.md

---
 .github/workflows/check-format.yml | 13 +++++++++++++
 CONTRIBUTING.md                    |  5 +++--
 2 files changed, 16 insertions(+), 2 deletions(-)
 create mode 100644 .github/workflows/check-format.yml
.github/workflows/check-format.yml new file +13 -0
new file mode 100644
index 00000000..a15cec05
@@ -0,0 +1,13 @@
+name: Check format
+
+on: [push, pull_request]
+
+jobs:
+  clang-format:
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v4
+
+      - name: check
+        run: make check-format
CONTRIBUTING.md +3 -2
index 7ec8cb0f..98467d5c 100644
@@ -53,8 +53,9 @@ When preparing patches, please follow these guidelines:
 -   Separate large patches into logical patches
 -   Patch descriptions must end with your "Signed-off-by" line. This means your
     code meets the Developer's certificate of origin, see below.
--   C code should be formatted using clang-format, using the .clang-format
-    configuration file at the root of this repository.
+-   C code should be formatted with clang-format, using the .clang-format
+    configuration file at the root of this repository. The targets `format` and
+    `check-format` are provided by the top-level Makefile for convenience.
 
 When adding new, large features or tools it is best to discuss the
 design on the mailing list prior to submitting the patch.
Signature · 1 line
2.51.0
#1 lore raw

Oct 25, 2025 10:39:40 Rahul Sandhu <[email protected]>:

Quoted 13 lines

---
.github/workflows/check-format.yml | 13 +++++++++++++ CONTRIBUTING.md                    |  5 +++--

2 files changed, 16 insertions(+), 2 deletions(-)

create mode 100644 .github/workflows/check-format.yml

.github/workflows/check-format.yml new file +0 -0
new file mode 100644
index 00000000..a15cec05

.github/workflows/check-format.yml line 10

Quoted 10 lines
.github/workflows/check-format.yml new file +10 -0
@@ -0,0 +1,13 @@
+name: Check format
+
+on: [push, pull_request]
+
+jobs:
+  clang-format:
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v4

Latest is v5

Quoted 21 lines
.github/workflows/check-format.yml new file +3 -0
+
+      - name: check
+        run: make check-format
CONTRIBUTING.md +0 -2
index 7ec8cb0f..98467d5c 100644
@@ -53,8 +53,9 @@ When preparing patches, please follow these guidelines:
-   Separate large patches into logical patches
-   Patch descriptions must end with your "Signed-off-by" line. This means your

     code meets the Developer's certificate of origin, see below. --   C code should be formatted using clang-format, using the .clang-format -    configuration file at the root of this repository.
+-   C code should be formatted with clang-format, using the .clang-format +    configuration file at the root of this repository. The targets format and +    check-format are provided by the top-level Makefile for convenience.

When adding new, large features or tools it is best to discuss the design on the mailing list prior to submitting the patch. --
2.51.0

#2 lore raw

PATCH v2 1/1 clang-format: add check-format workflow, update CONTRIBUTING.md

---
 .github/workflows/check-format.yml | 13 +++++++++++++
 CONTRIBUTING.md                    |  5 +++--
 2 files changed, 16 insertions(+), 2 deletions(-)
 create mode 100644 .github/workflows/check-format.yml

v2: bump actions/checkout to v5

.github/workflows/check-format.yml new file +13 -0
new file mode 100644
index 00000000..9be8b629
@@ -0,0 +1,13 @@
+name: Check format
+
+on: [push, pull_request]
+
+jobs:
+  clang-format:
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v5
+
+      - name: check
+        run: make check-format
CONTRIBUTING.md +3 -2
index 7ec8cb0f..98467d5c 100644
@@ -53,8 +53,9 @@ When preparing patches, please follow these guidelines:
 -   Separate large patches into logical patches
 -   Patch descriptions must end with your "Signed-off-by" line. This means your
     code meets the Developer's certificate of origin, see below.
--   C code should be formatted using clang-format, using the .clang-format
-    configuration file at the root of this repository.
+-   C code should be formatted with clang-format, using the .clang-format
+    configuration file at the root of this repository. The targets `format` and
+    `check-format` are provided by the top-level Makefile for convenience.
 
 When adding new, large features or tools it is best to discuss the
 design on the mailing list prior to submitting the patch.
Signature · 1 line
2.51.0
maintainer Acked-by on v2 1/1
#3 lore raw
Quoted 2 lines · Rahul Sandhu

Will defer merging until after make format is applied.

Quoted 47 lines
---
 .github/workflows/check-format.yml | 13 +++++++++++++
 CONTRIBUTING.md                    |  5 +++--
 2 files changed, 16 insertions(+), 2 deletions(-)
 create mode 100644 .github/workflows/check-format.yml

v2: bump actions/checkout to v5

.github/workflows/check-format.yml new file +13 -0
new file mode 100644
index 00000000..9be8b629
@@ -0,0 +1,13 @@
+name: Check format
+
+on: [push, pull_request]
+
+jobs:
+  clang-format:
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v5
+
+      - name: check
+        run: make check-format
CONTRIBUTING.md +3 -3
index 7ec8cb0f..98467d5c 100644
@@ -53,8 +53,9 @@ When preparing patches, please follow these guidelines:
 -   Separate large patches into logical patches
 -   Patch descriptions must end with your "Signed-off-by" line. This means your
     code meets the Developer's certificate of origin, see below.
--   C code should be formatted using clang-format, using the .clang-format
-    configuration file at the root of this repository.
+-   C code should be formatted with clang-format, using the .clang-format
+    configuration file at the root of this repository. The targets `format` and
+    `check-format` are provided by the top-level Makefile for convenience.
 
 When adding new, large features or tools it is best to discuss the
 design on the mailing list prior to submitting the patch.
--

2.51.0

maintainer
#4 lore raw
In reply to Christian Göttsche
Quoted 20 lines · Christian Göttsche

Oct 25, 2025 10:39:40 Rahul Sandhu <[email protected]>:

Quoted 17 lines

---
.github/workflows/check-format.yml | 13 +++++++++++++
CONTRIBUTING.md | 5 +++--

2 files changed, 16 insertions(+), 2 deletions(-)

create mode 100644 .github/workflows/check-format.yml

.github/workflows/check-format.yml new file +4 -0
new file mode 100644
index 00000000..a15cec05
@@ -0,0 +1,13 @@
+name: Check format
+
+on: [push, pull_request]
+
Quoted 8 lines

.github/workflows/check-format.yml line 10

Quoted 6 lines
.github/workflows/check-format.yml new file +6 -0
+jobs:
+  clang-format:
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v4

Latest is v5

Pardon my ignorance, but I see that we are using actions/checkoutv4 in run_tests.yml from which this was likely cut-and-pasted. Do we care?