From 49168546c48b7501c1ed7f23bdb9bf74dce58fa9 Mon Sep 17 00:00:00 2001 From: josephine-rutten Date: Thu, 17 Oct 2024 10:59:24 +0200 Subject: [PATCH] Added ruff to the pre-commit --- .pre-commit-config.yaml | 6 ++++++ src/cnaas_nms/db/git.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0fdf600c..c02dbc55 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,3 +18,9 @@ repos: rev: 6.1.0 hooks: - id: flake8 + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.6.1 + hooks: + - id: ruff + args: [ --fix, --exit-non-zero-on-fix, --show-fixes ] + exclude: (alembic/.*) diff --git a/src/cnaas_nms/db/git.py b/src/cnaas_nms/db/git.py index ba4b8971..e4ce24b3 100644 --- a/src/cnaas_nms/db/git.py +++ b/src/cnaas_nms/db/git.py @@ -7,6 +7,7 @@ from urllib.parse import urldefrag import yaml +from git.exc import GitCommandError, NoSuchPathError from cnaas_nms.app_settings import app_settings from cnaas_nms.db.device import Device, DeviceType @@ -28,7 +29,6 @@ from cnaas_nms.tools.event import add_event from cnaas_nms.tools.log import get_logger from git import InvalidGitRepositoryError, Repo -from git.exc import GitCommandError, NoSuchPathError class RepoType(enum.Enum):