From 4191ceb5ec0b19c8f1dac6cacee0d1924f6b9560 Mon Sep 17 00:00:00 2001 From: Gulshan Singh Date: Sun, 25 Feb 2024 15:02:50 -0800 Subject: [PATCH] Fix lint.sh (#2030) --- lint.sh | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/lint.sh b/lint.sh index 70bf9566f..bdd1b2382 100755 --- a/lint.sh +++ b/lint.sh @@ -26,25 +26,15 @@ while [[ $# -gt 0 ]]; do esac done -set -o xtrace - # Use Python virtual env for all programs used here if [[ -z "${PWNDBG_VENV_PATH}" ]]; then PWNDBG_VENV_PATH="./.venv" fi -# shfmt is not a Python program but a system binary -# so let's hack it into the virtualenv -# This is not great, but we can't add a single binary to $PATH -SHFMT_PATH=$(which shfmt) -if [[ ! -z "${SHFMT_PATH}" ]]; then - ln -s ${SHFMT_PATH} ${PWNDBG_VENV_PATH}/bin/shfmt 2> /dev/null || true -fi - -# Override PATH because we don't want any system-level binaries to be used -PATH="${PWNDBG_VENV_PATH}/bin/" source "${PWNDBG_VENV_PATH}/bin/activate" +set -o xtrace + LINT_FILES="pwndbg tests *.py" LINT_TOOLS="isort black ruff vermin mypy" @@ -62,7 +52,7 @@ call_shfmt() { local SHFMT_FILES=$(find . -name "*.sh" -not -path "./.venv/*") # Indents are four spaces, binary ops can start a line, indent switch cases, # and allow spaces following a redirect - shfmt ${FLAGS} -i 4 -bn -ci -sr -d . + shfmt ${FLAGS} -i 4 -bn -ci -sr -d ${SHFMT_FILES} else echo "shfmt not installed, skipping" fi