Skip to content

Commit

Permalink
ci: enable isort to run on every PR
Browse files Browse the repository at this point in the history
  • Loading branch information
sansyrox committed Sep 28, 2024
1 parent d5394e0 commit 305cb0c
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 14 deletions.
32 changes: 18 additions & 14 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
name: "Lint PR"
name: Lint PR

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read
pull_request:
branches: [main]

jobs:
main:
name: Validate PR title
lint:
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff isort black
- name: Run linters
run: |
ruff check .
isort --check-only --diff .
black --check --diff .
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,13 @@ repos:
args:
- --fix
- id: ruff-format
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
ci:
autoupdate_schedule: weekly
22 changes: 22 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,27 @@ exclude = ["src/*", ".git", "docs"]
[tool.ruff.mccabe]
max-complexity = 10

[tool.isort]
profile = "black"
line_length = 160

[tool.black]
line-length = 160
target-version = ['py38']
include = '\.pyi?$'
extend-exclude = '''
/(
# directories
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| build
| dist
)/
'''

[tool.maturin]
module-name = "robyn"

0 comments on commit 305cb0c

Please sign in to comment.