mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-12-11 18:13:26 +00:00
33 lines
570 B
Bash
Executable File
33 lines
570 B
Bash
Executable File
#!/bin/sh
|
|
set -eu
|
|
|
|
# Copyright 2023, Canonical Ltd.
|
|
# SPDX-License-Identifier: GPL-3.0
|
|
|
|
PYTHON_SCRIPTS=$(grep -l -r '^#! */usr/bin/python3$' .)
|
|
|
|
run_black() {
|
|
echo "Running black..."
|
|
black -C --check --diff . ${PYTHON_SCRIPTS}
|
|
}
|
|
|
|
run_isort() {
|
|
echo "Running isort..."
|
|
isort --check-only --diff .
|
|
}
|
|
|
|
run_flake8() {
|
|
echo "Running flake8..."
|
|
flake8 --max-line-length=99 --ignore=E203,W503 . $PYTHON_SCRIPTS
|
|
}
|
|
|
|
run_pylint() {
|
|
echo "Running pylint..."
|
|
pylint $(find * -name '*.py') $PYTHON_SCRIPTS
|
|
}
|
|
|
|
run_black
|
|
run_isort
|
|
run_flake8
|
|
run_pylint
|