From 6cebf146cbc28620799bdaf71ec1bc2775d80f42 Mon Sep 17 00:00:00 2001 From: WithoutPants <53250216+WithoutPants@users.noreply.github.com> Date: Thu, 4 Jul 2024 11:11:26 +1000 Subject: [PATCH] Fix validate-ui-quick to only run required checks --- Makefile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 560ab0466..088c1797d 100644 --- a/Makefile +++ b/Makefile @@ -379,9 +379,12 @@ fmt-ui-quick: # does not run tsc checks, as they are slow validate-ui-quick: cd ui/v2.5 && \ - yarn run eslint $$(git diff --name-only --relative --diff-filter d src | grep -e "\.tsx\?\$$") && \ - yarn run stylelint $$(git diff --name-only --relative --diff-filter d src | grep "\.scss") && \ - yarn run prettier --check $$(git diff --name-only --relative --diff-filter d . ../../graphql) + tsfiles=$$(git diff --name-only --relative --diff-filter d src | grep -e "\.tsx\?\$$"); \ + scssfiles=$$(git diff --name-only --relative --diff-filter d src | grep "\.scss"); \ + prettyfiles=$$(git diff --name-only --relative --diff-filter d . ../../graphql); \ + if [ -n "$$tsfiles" ]; then yarn run eslint $$tsfiles; fi && \ + if [ -n "$$scssfiles" ]; then yarn run stylelint $$scssfiles; fi && \ + if [ -n "$$prettyfiles" ]; then yarn run prettier --check $$prettyfiles; fi # runs all of the backend PR-acceptance steps .PHONY: validate-backend