From ddba96c2896a67904f55e02b69b062855e200a83 Mon Sep 17 00:00:00 2001 From: Ross McFarland Date: Wed, 5 Apr 2023 14:54:08 -0700 Subject: [PATCH] Include python in scripts directory in lint & formatting --- script/format | 2 +- script/lint | 2 +- script/update-requirements | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/script/format b/script/format index 1e9fe4f..2a8438d 100755 --- a/script/format +++ b/script/format @@ -2,7 +2,7 @@ set -e -SOURCES=$(find *.py octodns tests -name "*.py") +SOURCES="$(find *.py octodns tests -name '*.py') $(grep --files-with-matches '^#!.*python' script/*)" . env/bin/activate diff --git a/script/lint b/script/lint index 24c7643..fd0d36c 100755 --- a/script/lint +++ b/script/lint @@ -15,6 +15,6 @@ if [ ! -f "$ACTIVATE" ]; then fi . "$ACTIVATE" -SOURCES="*.py octodns/*.py octodns/*/*.py tests/*.py" +SOURCES="$(find *.py octodns tests -name '*.py') $(grep --files-with-matches '^#!.*python' script/*)" pyflakes $SOURCES diff --git a/script/update-requirements b/script/update-requirements index 7e749b4..7696f6d 100755 --- a/script/update-requirements +++ b/script/update-requirements @@ -1,10 +1,10 @@ #!/usr/bin/env python3 +import re from os.path import join from subprocess import check_call, check_output from sys import argv from tempfile import TemporaryDirectory -import re def print_packages(packages, heading): @@ -38,8 +38,9 @@ with TemporaryDirectory() as tmpdir: # pip installs the module itself along with deps so we need to get that out of # our list by finding the thing that was file installed during dev frozen = sorted([p for p in frozen if not p.startswith(our_package_name)]) -dev_frozen = sorted([p for p in dev_frozen - if not p.startswith(our_package_name)]) +dev_frozen = sorted( + [p for p in dev_frozen if not p.startswith(our_package_name)] +) print_packages(frozen, 'frozen') print_packages(dev_frozen, 'dev_frozen')