Skip to content

Commit 6eb52e6

Browse files
Merge pull request #1063 from DimitriPapadopoulos/repo-review
Apply assorted repo-review rules
2 parents 4d0d50b + 4a48455 commit 6eb52e6

9 files changed

+21
-8
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,17 @@ repos:
99
rev: v0.3.4
1010
hooks:
1111
- id: ruff
12-
args: [--fix, --exit-non-zero-on-fix]
12+
args: [--fix, --exit-non-zero-on-fix, --show-fixes]
1313
- id: ruff-format
1414

1515
- repo: https://github.com/tox-dev/pyproject-fmt
16-
rev: "1.7.0"
16+
rev: 1.7.0
1717
hooks:
1818
- id: pyproject-fmt
1919
exclude: docs/examples/
2020

2121
- repo: https://github.com/pre-commit/mirrors-mypy
22-
rev: 'v1.9.0'
22+
rev: v1.9.0
2323
hooks:
2424
- id: mypy
2525
args: [--strict]
@@ -31,3 +31,8 @@ repos:
3131
- importlib_metadata
3232
- typing-extensions>=4.5
3333
- rich
34+
35+
- repo: https://github.com/scientific-python/cookie
36+
rev: 2024.04.23
37+
hooks:
38+
- id: sp-repo-review

_own_version_helper.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from typing import Callable
1414

1515
from setuptools import build_meta as build_meta
16+
1617
from setuptools_scm import Configuration
1718
from setuptools_scm import _types as _t
1819
from setuptools_scm import get_version

docs/examples/version_scheme_code/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from __future__ import annotations
44

55
from setuptools import setup
6+
67
from setuptools_scm import ScmVersion
78

89

pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,9 @@ version = { attr = "_own_version_helper.version"}
116116
[tool.setuptools_scm]
117117

118118
[tool.ruff]
119+
src = ["src"]
119120
fix = true
120-
lint.select = ["E", "F", "B", "U", "YTT", "C", "DTZ", "PYI", "PT", "I", "FURB", "RUF"]
121+
lint.select = ["E", "F", "B", "UP", "YTT", "C", "DTZ", "PYI", "PT", "I", "FURB", "RUF"]
121122
lint.ignore = ["B028"]
122123
lint.preview = true
123124

@@ -127,7 +128,11 @@ from-first = false
127128
lines-between-types = 1
128129
order-by-type = true
129130

131+
[tool.repo-review]
132+
ignore = ["PP305", "GH103", "GH212", "MY100", "PC111", "PC160", "PC170", "PC180", "PC901"]
133+
130134
[tool.pytest.ini_options]
135+
minversion = "7"
131136
testpaths = ["testing"]
132137
filterwarnings = [
133138
"error",
@@ -137,7 +142,7 @@ filterwarnings = [
137142
log_level = "debug"
138143
log_cli_level = "info"
139144
# disable unraisable until investigated
140-
addopts = ["-p", "no:unraisableexception"]
145+
addopts = ["-ra", "--strict-config", "--strict-markers", "-p", "no:unraisableexception"]
141146
markers = [
142147
"issue(id): reference to github issue",
143148
"skip_commit: allows to skip committing in the helpers",

testing/test_basic_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from pathlib import Path
88

99
import pytest
10+
1011
import setuptools_scm
1112

1213
from setuptools_scm import Configuration
@@ -15,7 +16,6 @@
1516
from setuptools_scm.integration import data_from_mime
1617
from setuptools_scm.version import ScmVersion
1718
from setuptools_scm.version import meta
18-
1919
from testing.wd_wrapper import WorkDir
2020

2121
c = Configuration()

testing/test_git.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
from unittest.mock import patch
1818

1919
import pytest
20+
2021
import setuptools_scm._file_finders
2122

2223
from setuptools_scm import Configuration

testing/test_hg_git.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
from setuptools_scm._run_cmd import has_command
66
from setuptools_scm._run_cmd import run
7-
87
from testing.wd_wrapper import WorkDir
98

109

testing/test_integration.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from pathlib import Path
1010

1111
import pytest
12+
1213
import setuptools_scm._integration.setuptools
1314

1415
from setuptools_scm import Configuration

testing/test_mercurial.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from pathlib import Path
66

77
import pytest
8+
89
import setuptools_scm._file_finders
910

1011
from setuptools_scm import Configuration
@@ -13,7 +14,6 @@
1314
from setuptools_scm.hg import archival_to_version
1415
from setuptools_scm.hg import parse
1516
from setuptools_scm.version import format_version
16-
1717
from testing.wd_wrapper import WorkDir
1818

1919
pytestmark = pytest.mark.skipif(

0 commit comments

Comments
 (0)