From 737d3888bed52ced807a908ef6f3b596c66569d4 Mon Sep 17 00:00:00 2001 From: "Gary Kwong [:gkw]" Date: Mon, 25 Dec 2023 17:34:14 -0800 Subject: [PATCH] Update refurb execution code on CI --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6599526..739d2d8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -67,7 +67,7 @@ jobs: run: python -u -m ruff . - name: Run with refurb to find code that can be written in a more modern way run: | - python -c 'exec("from pathlib import Path;import shutil;import subprocess;\ntry: import tomllib;\nexcept ImportError: import tomli as tomllib;\nwith Path(\"pyproject.toml\").open(mode=\"rb\") as fp: c = tomllib.load(fp); n = c[\"project\"][\"name\"];\nif not (r := shutil.which(\"refurb\")): raise RuntimeError(\"Please first install refurb\");\nprint(subprocess.run([y for y in [r,\"--\",\"-p\",n] if y],capture_output=True,text=True).stdout.rstrip())")' + python -c 'exec("from pathlib import Path;import shutil,subprocess,sys;\ntry: import tomllib;\nexcept ImportError: import tomli as tomllib;\nwith Path(\"pyproject.toml\").open(mode=\"rb\") as fp: c = tomllib.load(fp); n = c[\"project\"][\"name\"];\nif not (r := shutil.which(\"refurb\")): raise RuntimeError(\"Please first install refurb\");\nsubp=subprocess.run([y for y in [r,\"--\",\"-p\",n] if y],stderr=subprocess.STDOUT,stdout=subprocess.PIPE,text=True);print(subp.stdout.rstrip())");raise SystemExit(subp.returncode)' - name: Run with vulture to find dead code if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') run: |