Skip to content

Commit

Permalink
Linting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
filippomc committed Sep 17, 2024
1 parent 08b9645 commit 7eb8ca3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lint-check.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/bin/bash
# Run autopep8 with --diff and capture the output
diff_output=$(autopep8 --select=E1,E2,E3,W,E4,E7,E502 --recursive --diff --exclude '**/cloudharness_cli/**/*,**/models/*,**/model/*' .)
diff_output=$(python -m autopep8 --select=E1,E2,E3,W,E4,E7,E502 --recursive --diff --exclude '**/cloudharness_cli/**/*,**/models/*,**/model/*' .)
# Check if the output is non-empty
if [ -n "$diff_output" ]; then
echo $diff_output
echo "Code style issues found in the above files. Please run autopep8 to fix."
printf "%s\n" "$diff_output"
echo "Code style issues found in the above files. To fix you can run: "
echo "autopep8 --select=E1,E2,E3,W,E4,E7,E502 --recursive --in-place --exclude '**/cloudharness_cli/**/*,**/models/*,**/model/*'"
exit 1
fi

0 comments on commit 7eb8ca3

Please sign in to comment.