From 45665e823c7736ff25006d2b77426df7998dc00c Mon Sep 17 00:00:00 2001 From: Gulshan Singh Date: Wed, 6 Mar 2024 09:41:23 -0800 Subject: [PATCH] Make ruff output in github format if running on CI (#2070) --- lint.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lint.sh b/lint.sh index 6c801ef3e..b6b56e32f 100755 --- a/lint.sh +++ b/lint.sh @@ -66,8 +66,15 @@ if [[ $FIX == 1 ]]; then else isort --check-only --diff ${LINT_FILES} black --check --diff ${LINT_FILES} - ruff check --output-format=full ${LINT_FILES} call_shfmt + + if [[ -z "$GITHUB_ACTIONS" ]]; then + RUFF_OUTPUT_FORMAT=full + else + RUFF_OUTPUT_FORMAT=github + fi + + ruff check --output-format="${RUFF_OUTPUT_FORMAT}" ${LINT_FILES} fi # Checking minimum python version