Skip to content

Commit f1176fa

Browse files
committed
ruff attempt
1 parent 70d0ffe commit f1176fa

3 files changed

Lines changed: 94 additions & 70 deletions

File tree

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Check Carrot Mapper Code Quality
2+
3+
###
4+
# copied from https://github.com/Health-Informatics-UoN/carrot-transform/blob/main/.github/workflows/check.quality.yml
5+
6+
permissions:
7+
contents: read
8+
pull-requests: write
9+
10+
on:
11+
push:
12+
13+
jobs:
14+
15+
ruff:
16+
name: Run Ruff
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
21+
steps:
22+
- name: Check out the repo
23+
uses: actions/checkout@v4
24+
25+
- name: Run Ruff Checks
26+
uses: astral-sh/ruff-action@39f75e526a505e26a302f8796977b50c13720edf # v3.2.1
27+
with:
28+
args: "check --select F401 --select I ."
29+
30+
- name: Run Ruff Format
31+
uses: astral-sh/ruff-action@39f75e526a505e26a302f8796977b50c13720edf # v3.2.1
32+
with:
33+
args: "format --check --diff"
34+
35+
coverage:
36+
name: carrot-mapper coverage
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Check out repository
40+
uses: actions/checkout@v4
41+
42+
- name: Install uv
43+
uses: astral-sh/setup-uv@v5
44+
45+
- name: Run tests
46+
# run the coverage check, but, don't worry about coverage of the tests themselves
47+
# ... or the docker tests ...
48+
run: |
49+
uv run coverage run --omit=tests/* -m pytest --junitxml=pytest.xml
50+
uv run coverage xml
51+
52+
# adds a comment to the PR detailing code coverage
53+
- name: Pytest coverage comment
54+
if: github.event_name == 'pull_request'
55+
uses: MishaKav/pytest-coverage-comment@main
56+
with:
57+
pytest-xml-coverage-path: coverage.xml
58+
junitxml-path: pytest.xml
59+
continue-on-error: true

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ test = [
1818
]
1919
dev = [
2020
"pre-commit>=3.6.1,<4",
21-
"isort>=5.13.2,<6",
22-
"black>=24.2.0,<25",
2321
"mypy>=1.8.0,<2",
2422
"flake8>=7.0.0,<8",
23+
"pytest>=7.4.4",
24+
"coverage>=7.4.1",
25+
"ruff>=0.13.0",
2526
]
2627

2728
[tool.uv]

uv.lock

Lines changed: 32 additions & 68 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)