Skip to content

Commit

Permalink
Adding ruff pre-commit implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristian Pozo Gonzalez committed Sep 11, 2024
1 parent 8ed2a24 commit 110ce35
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .pre-commit-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.8
hooks:
- id: ruff
name: ruff linting
args: ["--config=pyproject.toml"]
- id : ruff-format
name: ruff formatting
args: ["--config=pyproject.toml"]
30 changes: 30 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,33 @@
[build-system]
requires = ["setuptools >= 40.6.0", "wheel", "setuptools_scm[toml]>=3.4"]
build-backend = "setuptools.build_meta"

[project.optional-dependencies]
dev = ['pre-commit~=3.8.0',
]

[tool.ruff]
exclude = ["docs", "dev"]
# Like black
line-length = 88
indent-width = 4

[tool.ruff.lint]
ignore = ["E741"]
extend-ignore = ["E203","E712"]

[tool.ruff.lint.per-file-ignores]
"examples/*" = ["E402"]

[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"

# Like Black, indent with spaces, rather than tabs.
indent-style = "space"

# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false

# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"

0 comments on commit 110ce35

Please sign in to comment.