Skip to content

Commit

Permalink
Revise check_clang_format workflow to report all errors
Browse files Browse the repository at this point in the history
- The checker fails after finding a file with a format error,
  requiring multiple commits to find all the errors. This CL
  updates the workflow to process all changed files in a single
  invocation of clang-format, which should solve the problem.

Signed-off-by: Derek G Foster <[email protected]>
  • Loading branch information
ffoulkes committed Mar 4, 2024
1 parent 889c17e commit dde54a6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
uses: actions/checkout@v4

- name: Get list of changed Files
id: changes
id: changed
uses: tj-actions/changed-files@v42
with:
files: |
Expand All @@ -142,7 +142,6 @@ jobs:
**.cc
- name: Check for formatting errors
if: steps.changed.outputs.any_changed == 'true'
run: |
for file in ${{ steps.changes.outputs.all_changed_files }}; do
clang-format --dry-run -Werror $file
done
clang-format -n -Werror ${{ steps.changed.outputs.all_changed_files }}
4 changes: 2 additions & 2 deletions switchlink/switchlink_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

#include <fcntl.h>
#include <linux/errno.h>
#include <linux/ethtool.h>
#include <linux/if.h>
#include <linux/if_bridge.h>
#include <linux/sockios.h>
Expand All @@ -31,10 +30,11 @@
#include <netlink/netlink.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <linux/ethtool.h>

#include "switchlink.h"
#include "switchlink_handle.h"
#include "switchlink_int.h"
#include "switchlink_handle.h"
#include "switchlink_utils.h"

#if defined(ES2K_TARGET)
Expand Down
5 changes: 2 additions & 3 deletions switchlink/switchlink_link_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,8 @@ class SwitchlinkTest : public ::testing::Test {
*/
TEST_F(SwitchlinkTest, can_create_generic_link) {
struct ifinfomsg hdr = {
.ifi_family = 0,
.ifi_type = ARPHRD_ETHER,
.ifi_index = 6,
.ifi_family = 0, .ifi_type = ARPHRD_ETHER,
.ifi_index = 6,
.ifi_flags = 0x11043,
.ifi_change = 0,
};
Expand Down

0 comments on commit dde54a6

Please sign in to comment.