Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/python_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,9 @@ jobs:
run: |
poetry install --with dev

- name: Lint with ruff
run: |
poetry run ruff check

- name: Run liter
run: |
./check_all_python_scripts.sh
./check_all_python_files.sh

- name: Install language dependencies
working-directory: ${{github.workspace}}/system_setup_scripts
Expand Down
2 changes: 2 additions & 0 deletions check_all_python_scripts.sh → check_all_python_files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

set -euo pipefail

poetry run ruff check .
poetry run mypy .
poetry run bandit -c bandit.yml -r .

find . -name "*.py" -not -path "./tests/example_data/python3/*" -exec ./check_python_file.sh {} +
18 changes: 9 additions & 9 deletions check_python_file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@ declare -i exit_code=0
for cur_file in "$@"
do
printf "Checking \"%s\"\n" "${cur_file}"
printf "Checking with pylint:\n"
if ! poetry run pylint "${cur_file}" ; then
pylint_output=$(poetry run pylint "${cur_file}" 2>&1) || {
printf "Checking with pylint:\n%s\n" "${pylint_output}"
exit_code=1
fi
}

printf "Checking with flake8:\n"
if ! poetry run flake8 "${cur_file}" --count --max-line-length=88 --show-source --ignore=E203; then
flake8_output=$(poetry run flake8 "${cur_file}" --count --max-line-length=88 --show-source --ignore=E203,W503 2>&1) || {
printf "Checking with flake8:\n%s\n" "${flake8_output}"
exit_code=1
fi
}

printf "Checking with mypy:\n"
if ! poetry run mypy "${cur_file}"; then
mypy_output=$(poetry run mypy "${cur_file}" 2>&1) || {
printf "Checking with mypy:\n%s\n" "${mypy_output}"
exit_code=1
fi
}
done

if [[ ${exit_code} -eq 0 ]] ; then
Expand Down
Loading