Skip to content

Commit

Permalink
add ruff to pre-commit and replace black action with pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
0xkarmacoma committed Aug 26, 2024
1 parent 8e348b2 commit 2ae9e0d
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 17 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Lint
# Deprecated: use pre-commit instead
# name: Lint

on: [push, pull_request]
# on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: psf/black@stable
# jobs:
# lint:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: psf/black@stable
11 changes: 11 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: pre-commit

on: [push, pull_request]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
- uses: pre-commit/[email protected]
30 changes: 21 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
repos:
- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
# It is recommended to specify the latest version of Python
# supported by your project here, or alternatively use
# pre-commit's default_language_version, see
# https://pre-commit.com/#top_level-default_language_version
language_version: python3.12
# - repo: https://github.com/psf/black
# rev: 23.7.0
# hooks:
# - id: black
# # It is recommended to specify the latest version of Python
# # supported by your project here, or alternatively use
# # pre-commit's default_language_version, see
# # https://pre-commit.com/#top_level-default_language_version
# language_version: python3.12

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.2
hooks:
# Run the linter.
- id: ruff
# don't autofix by default, this runs in CI
# to run fix locally, use `ruff check src/ --fix`
# args: [ --fix ]
# Run the formatter.
- id: ruff-format

0 comments on commit 2ae9e0d

Please sign in to comment.