Skip to content
Snippets Groups Projects
Commit 0744454a authored by Eva Bardou's avatar Eva Bardou :frog: Committed by Yoann Schneider
Browse files

Update the pre-commit configuration in the cookiecutter template

parent fc1fc1c9
No related branches found
No related tags found
1 merge request!459Update the pre-commit configuration in the cookiecutter template
Pipeline #146640 passed
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.278
rev: v0.1.6
hooks:
# Run the linter.
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.11.0
hooks:
- id: black
# Run the formatter.
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-ast
- id: check-docstring-first
......@@ -27,7 +26,7 @@ repos:
- id: check-json
- id: requirements-txt-fixer
- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
rev: v2.2.6
hooks:
- id: codespell
args: ['--write-changes']
......
......@@ -14,7 +14,35 @@ dependencies = { file = ["requirements.txt"] }
[tool.ruff]
exclude = [".git", "__pycache__"]
ignore = ["E501"]
select = ["E", "F", "T1", "W", "I"]
select = [
# pycodestyle
"E",
"W",
# Pyflakes
"F",
# Flake8 Debugger
"T1",
# Isort
"I",
# Implicit Optional
"RUF013",
# Invalid pyproject.toml
"RUF200",
# pyupgrade
"UP",
# flake8-bugbear
"B",
# flake8-simplify
"SIM",
# flake8-pytest-style
"PT",
# flake8-use-pathlib
"PTH",
]
[tool.ruff.per-file-ignores]
# Ignore `pytest-composite-assertion` rules of `flake8-pytest-style` linter for non-test files
"worker_{{ cookiecutter.slug }}/**/*.py" = ["PT018"]
[tool.ruff.isort]
known-first-party = ["arkindex", "arkindex_worker"]
......
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import re
......
# -*- coding: utf-8 -*-
import os
import pytest
......@@ -8,7 +7,7 @@ from arkindex_worker.worker.base import BaseWorker
@pytest.fixture(autouse=True)
def setup_environment(responses, monkeypatch) -> None:
def _setup_environment(responses, monkeypatch) -> None:
"""Setup needed environment variables"""
# Allow accessing remote API schemas
......
# -*- coding: utf-8 -*-
import importlib
......
# -*- coding: utf-8 -*-
import logging
logging.basicConfig(
......
# -*- coding: utf-8 -*-
from logging import Logger, getLogger
from arkindex_worker.models import Element
......
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