-
Notifications
You must be signed in to change notification settings - Fork 74
42 lines (36 loc) · 1.15 KB
/
ruff-formatter.yml
File metadata and controls
42 lines (36 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: Ruff Formatter Check
permissions:
contents: read
on:
pull_request:
types: [opened, synchronize, reopened, edited]
jobs:
ruff:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9.13"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up caching for Ruff virtual environment
id: cache-ruff
uses: actions/cache@v4
with:
path: .venv
key: v2-pypi-py-ruff-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}
restore-keys: |
v2-pypi-py-ruff-${{ matrix.python-version }}-
- name: Set up Ruff virtual environment if cache is missed
if: steps.cache-ruff.outputs.cache-hit != 'true'
run: |
python -m venv .venv
.venv/bin/python -m pip install ruff==0.11.5
- name: Ruff format check
run: |
.venv/bin/ruff format --diff bittensor_cli
.venv/bin/ruff format --diff tests