From 42016bc0670b138fc72f6469d4e12a754d8caa27 Mon Sep 17 00:00:00 2001 From: Jeremy Reizenstein Date: Wed, 14 Apr 2021 12:48:51 -0700 Subject: [PATCH] linter to survive flake8 crash Summary: Internally flake8 sometimes crashes. Stop the rest of the linter being bypassed when this happens. Reviewed By: theschnitz Differential Revision: D27765255 fbshipit-source-id: 7ad1fb4630a05f4bc3763cf13370f5e4e00228de --- dev/linter.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev/linter.sh b/dev/linter.sh index ce9289e6..300efd87 100755 --- a/dev/linter.sh +++ b/dev/linter.sh @@ -22,14 +22,14 @@ echo "Running black..." black "${DIR}" echo "Running flake..." -flake8 "${DIR}" +flake8 "${DIR}" || true echo "Running clang-format ..." clangformat=$(command -v clang-format-8 || echo clang-format) find "${DIR}" -regex ".*\.\(cpp\|c\|cc\|cu\|cuh\|cxx\|h\|hh\|hpp\|hxx\|tcc\|mm\|m\)" -print0 | xargs -0 "${clangformat}" -i # Run arc and pyre internally only. -if [[ -f tests/TARGETS ]] +if [[ -f "${DIR}/tests/TARGETS" ]] then (cd "${DIR}"; command -v arc > /dev/null && arc lint) || true