Skip to content
This repository has been archived by the owner on Dec 26, 2022. It is now read-only.

Commit

Permalink
fix(Endpoint): Ignore to format legato project
Browse files Browse the repository at this point in the history
The autoformat hook doesn't need to format the legato project.

Add the hooks/format-exclude-list for skip the directory which
doesn't need to format by clang-format.

Close #713
  • Loading branch information
splasky committed Jul 14, 2020
1 parent 6535f37 commit 8ce97ae
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions hooks/format-exclude-list
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
third_party
output_base
legato
_build_endpoint
4 changes: 2 additions & 2 deletions hooks/formatter
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/bash

for file in $(find $(git rev-parse --show-toplevel) | egrep "\.(c|cc|cpp|h|hh|hpp|m|mm)\$" | egrep -v "third_party|output_base");
for file in $(find $(git rev-parse --show-toplevel) | egrep "\.(c|cc|cpp|h|hh|hpp|m|mm)\$" | egrep -v -f hooks/format-exclude-list)
do
clang-format -style=file -fallback-style=none -i $file
done

for file in $(find $(git rev-parse --show-toplevel) | egrep "\BUILD\$" | egrep -v "third_party|output_base" )
for file in $(find $(git rev-parse --show-toplevel) | egrep "\BUILD\$" | egrep -v -f hooks/format-exclude-list )
do
buildifier $file
done
Expand Down

0 comments on commit 8ce97ae

Please sign in to comment.