From 71d94bbeab98c10dd3811933933046306b01d425 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 6 Nov 2021 02:55:37 -0400 Subject: [PATCH] Move Flake configuration into dedicated file Avoid passing arguments in the script. --- .flake8 | 12 ++++++++++++ lint | 8 +------- 2 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 .flake8 diff --git a/.flake8 b/.flake8 new file mode 100644 index 00000000..810a8500 --- /dev/null +++ b/.flake8 @@ -0,0 +1,12 @@ +[flake8] +# We ignore the following errors: +# * W503 (line break before binary operator): Black moves these to new lines +# * E501 (line too long): Long lines are a fact of life in comment blocks; Black handles active instances of this +# * E203 (whitespace before ':'): Black recommends this as disabled +ignore = W503, E501 +extend-ignore = E203 +# We exclude the Debian, migrations, and provisioner examples +exclude = debian,api-daemon/migrations/versions,api-daemon/provisioner/examples +# Set the max line length to 88 for Black +max-line-length = 88 + diff --git a/lint b/lint index eb2392f6..e940025b 100755 --- a/lint +++ b/lint @@ -4,13 +4,7 @@ if ! which flake8 &>/dev/null; then exit 1 fi -# We ignore the following errors: -# * W503 (line break before binary operator): Black moves these to new lines -# * E501 (line too long): Long lines are a fact of life in comment blocks; Black handles active instances of this -flake8 \ - --ignore=W503,E501 \ - --exclude=debian,api-daemon/migrations/versions,api-daemon/provisioner/examples \ - --max-line-length=88 +flake8 ret=$? if [[ $ret -eq 0 ]]; then echo "No linting issues found!"