Skip to content

Commit

Permalink
Add pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
HonzaCuhel committed Oct 13, 2024
1 parent ecdb338 commit 4f32288
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 4 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: pre-commit

on:
pull_request:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: '3.8'
- uses: pre-commit/[email protected]
28 changes: 28 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
types_or: [python, pyi]

- repo: https://github.com/ambv/black
rev: 23.3.0
hooks:
- id: black
language_version: python3.8

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: no-commit-to-branch
args: ['--branch', 'main', '--branch', 'dev']

- repo: https://github.com/executablebooks/mdformat
rev: 0.7.10
hooks:
- id: mdformat
additional_dependencies:
- mdformat-gfm
- mdformat-toc
exclude: '.github/'
6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,10 @@ optional-dependencies = { dev = { file = ["requirements-dev.txt"] } }

[tool.ruff]
target-version = "py38"
line-length = 88
indent-width = 4

[tool.ruff.lint]
ignore = ["F403", "B028", "B905", "D1", "W191"]
select = ["E4", "E7", "E9", "F", "W", "B", "I"]
ignore = ["F403", "B028", "B905", "D1"]
select = ["E4", "E7", "E9", "F", "W", "B", "I", "FA"]

[tool.ruff.pydocstyle]
convention = "google"
Expand Down

0 comments on commit 4f32288

Please sign in to comment.