Mentions légales du service

Skip to content
Snippets Groups Projects
Unverified Commit 3fb21c46 authored by Henry Schreiner's avatar Henry Schreiner Committed by GitHub
Browse files

chore: move to using Ruff (#85)

parent 32da0259
No related branches found
No related tags found
No related merge requests found
......@@ -33,13 +33,20 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace
# Runs Black, pyupgrade, isort, autoflake, blacken-docs
- repo: https://github.com/Zac-HD/shed
rev: 2023.3.1
# Black, the code formatter, natively supports pre-commit
- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: shed
- id: black
exclude: ^(docs)
# Check linting and style issues
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.0.263"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
# Changes tabs to spaces
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.5.1
......
......@@ -10,9 +10,7 @@
#
# All configuration values have a default; values that are commented out
# serve to show the default.
import os
import sys
from __future__ import annotations
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
......
from __future__ import annotations
import nox
nox.options.sessions = ["lint", "tests"]
......
......@@ -44,3 +44,46 @@ test-command = "pytest {project}/tests"
test-extras = ["test"]
test-skip = ["*universal2:arm64"]
build-verbosity = 1
[tool.ruff]
select = [
"E", "F", "W", # flake8
"B", # flake8-bugbear
"I", # isort
"ARG", # flake8-unused-arguments
"C4", # flake8-comprehensions
"EM", # flake8-errmsg
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"G", # flake8-logging-format
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"RET", # flake8-return
"RUF", # Ruff-specific
"SIM", # flake8-simplify
"T20", # flake8-print
"UP", # pyupgrade
"YTT", # flake8-2020
"EXE", # flake8-executable
"NPY", # NumPy specific rules
"PD", # pandas-vet
]
extend-ignore = [
"PLR", # Design related pylint codes
"E501", # Line too long
]
target-version = "py37"
src = ["src"]
unfixable = [
"T20", # Removes print statements
"F841", # Removes unused variables
]
flake8-unused-arguments.ignore-variadic-names = true
isort.required-imports = ["from __future__ import annotations"]
[tool.ruff.per-file-ignores]
"tests/**" = ["T20"]
from __future__ import annotations
from ._core import __doc__, __version__, add, subtract
__all__ = ["__doc__", "__version__", "add", "subtract"]
from __future__ import annotations
import scikit_build_example as m
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment