Skip to content

Commit

Permalink
Restrict refurb running code to Windows only
Browse files Browse the repository at this point in the history
  • Loading branch information
nth10sd committed Dec 26, 2023
1 parent 737d388 commit c401985
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ jobs:
- name: Run with ruff
run: python -u -m ruff .
- name: Run with refurb to find code that can be written in a more modern way
if: startsWith(runner.os, 'Linux')
run: |
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
Expand Down

0 comments on commit c401985

Please sign in to comment.