Skip to content

Commit 5b2e07b

Browse files
committed
Adds Ruff Format checker
1 parent 56dd47e commit 5b2e07b

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Ruff Formatter Check
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, edited]
6+
7+
jobs:
8+
ruff:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: ["3.9.13"]
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Set up caching for Ruff virtual environment
23+
id: cache-ruff
24+
uses: actions/cache@v4
25+
with:
26+
path: .venv
27+
key: v2-pypi-py-ruff-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
28+
restore-keys: |
29+
v2-pypi-py-ruff-${{ matrix.python-version }}-
30+
31+
- name: Set up Ruff virtual environment if cache is missed
32+
if: steps.cache-ruff.outputs.cache-hit != 'true'
33+
run: |
34+
python -m venv .venv
35+
.venv/bin/python -m pip install ruff==0.11.5
36+
37+
- name: Ruff format check
38+
run: |
39+
.venv/bin/ruff format --diff bittensor_cli
40+
.venv/bin/ruff format --diff tests

0 commit comments

Comments
 (0)