Skip to content

Commit

Permalink
Switch from black to ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
madeddie committed May 21, 2024
1 parent 1d8f26a commit 20976a5
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 52 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
name: CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["pypy3.9", "pypy3.10", "3.8", "3.9", "3.10", "3.11", "3.12"]

permissions:
pull-requests: write

steps:
- uses: actions/checkout@v4
- uses: eifinger/setup-rye@v3
id: setup-rye
with:
enable-cache: true
cache-prefix: ${{ matrix.python-version }}
- name: pin python-version ${{ matrix.python-version }}
if: steps.setup-rye.outputs.cache-hit != 'true'
run: rye pin ${{ matrix.python-version }}
- name: install dependencies
if: steps.setup-rye.outputs.cache-hit != 'true'
run: |
rye sync --no-lock
- name: run ruff
uses: chartboost/ruff-action@v1
- name: run tests
run: |
echo '```' > pytest.log
rye test | tee -a pytest.log
echo '```' >> pytest.log
- name: PR comment pytest output
uses: thollander/actions-comment-pull-request@v2
with:
filePath: pytest.log
if: github.event_name == 'pull_request'
49 changes: 0 additions & 49 deletions .github/workflows/test.yml

This file was deleted.

11 changes: 8 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ repos:
- id: check-merge-conflict
- id: check-json
- id: no-commit-to-branch
- repo: https://github.com/psf/black
rev: 22.10.0
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.4
hooks:
- id: black
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
hooks:
Expand Down

0 comments on commit 20976a5

Please sign in to comment.