Skip to content

Commit

Permalink
Github action fix only: fail on AStyle failure. (#1024)
Browse files Browse the repository at this point in the history
The Github action wasn't failing if AStyle returned an error.  It does now.
  • Loading branch information
RobMeades authored Oct 22, 2023
1 parent 11f9f77 commit 628d3fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,4 @@ jobs:
sudo apt install doxygen astyle python3
- name: check
run: |
python3 astyle.py
UBX_WORKDIR="$(pwd)" doxygen
python3 astyle.py && UBX_WORKDIR="$(pwd)" doxygen
6 changes: 3 additions & 3 deletions astyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
stdout=subprocess.PIPE, stderr=subprocess.PIPE,
universal_newlines=True) as astyle:
fail = False
output = astyle.communicate()
for line in output:
output, _ = astyle.communicate()
for line in output.splitlines():
if line.startswith("Formatted"):
fail = True
print (line, end="")
print (line)
if astyle.returncode != 0:
fail = True
sys.exit(1 if fail else 0)

0 comments on commit 628d3fc

Please sign in to comment.