diff --git a/ruff.toml b/ruff.toml new file mode 100644 index 0000000..2a1ee18 --- /dev/null +++ b/ruff.toml @@ -0,0 +1,13 @@ +target-version = "py312" + +[lint] +select = ["ALL"] +ignore = [ + "ANN", # flake8-annotations (ANN) + "COM812", # missing-trailing-comma + "D", # pydocstyle (D) + "RET504", # Unnecessary assignment to X before `return` statement +] + +[lint.per-file-ignores] +"tests/**" = ["S101"] # assert is expected in tests diff --git a/src/git_commit_guard/__init__.py b/src/git_commit_guard/__init__.py index 4aa5c11..2219da6 100644 --- a/src/git_commit_guard/__init__.py +++ b/src/git_commit_guard/__init__.py @@ -1,13 +1,13 @@ import re import subprocess import sys +import tomllib from argparse import ArgumentParser from dataclasses import dataclass, field from enum import StrEnum from pathlib import Path import nltk -import tomllib from nltk.corpus import wordnet TYPES = frozenset( diff --git a/tests/test_git_commit_guard.py b/tests/test_git_commit_guard.py index 1e6846d..80935d6 100644 --- a/tests/test_git_commit_guard.py +++ b/tests/test_git_commit_guard.py @@ -3,6 +3,7 @@ from unittest.mock import MagicMock, patch import pytest + from git_commit_guard import ( Result, _download_if_missing, @@ -21,8 +22,6 @@ main, ) -# ruff: noqa: S101 # Use of `assert` detected - @pytest.fixture(scope="session", autouse=True) def nltk_data():