Skip to content

Commit

Permalink
Clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
marianabuhazi committed May 7, 2024
1 parent 4e1122f commit 9d2b1a0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/regression-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:
pip3 install vsg
echo 'export PATH="$PATH:/home/espuser/.local/bin/"' >> ~/.bashrc
# - name: Install clang-format-10
# run: |
# sudo apt-get update
# sudo apt-get install clang-format-10
- name: Install clang-format
run: |
sudo apt-get update
sudo apt-get install clang-format
- name: Install autopep8
run: |
Expand Down
4 changes: 2 additions & 2 deletions utils/scripts/actions-pipeline/code-format/format_modified.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ esac
local output
case "$type" in
c | h | cpp | hpp)
# Format with clang-format-10
output=$(clang-format-10 $clang_format_edit "$file_to_format" 2>&1);;
# Format with clang-format
output=$(clang-format $clang_format_edit "$file_to_format" 2>&1);;
py)
# Format with autopep8
output=$(python3 -m autopep8 $autopep8_edit -a -a "$file_to_format" 2>&1);;
Expand Down
6 changes: 3 additions & 3 deletions utils/scripts/actions-pipeline/code-format/format_repo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# # # # # # # # # # # # # # # # # # # # # # # # # # # #
# This program recurses through all directories in #
# the /esp repository and formats all files using #
# clang-format-10, autopep8, verible, or vsg. #
# clang-format, autopep8, verible, or vsg. #
# # # # # # # # # # # # # # # # # # # # # # # # # # # #

# Output styles
Expand Down Expand Up @@ -71,7 +71,7 @@ find_c_h_files() {
local output
if [[ -f "$file" ]]; then
echo -n "Formatting $(basename "$file")..."
output=$(clang-format-10 -i "$file" 2>&1)
output=$(clang-format -i "$file" 2>&1)
if [ ! $? -eq 0 ]; then
echo -e " ${RED}FAILED${NC}"
echo "$output" | sed 's/^/ /'
Expand All @@ -92,7 +92,7 @@ find_cpp_hpp_files() {
for file in "$dir"/*.cpp "$dir"/*.hpp; do
if [[ -f "$file" ]]; then
echo -n "Formatting $(basename "$file")..."
output=$(clang-format-10 -i "$file" 2>&1)
output=$(clang-format -i "$file" 2>&1)
if [ ! $? -eq 0 ]; then
echo -e " ${RED}FAILED${NC}"
echo "$output" | sed 's/^/ /'
Expand Down

0 comments on commit 9d2b1a0

Please sign in to comment.