Skip to content

Commit 9515afc

Browse files
committed
Fixed linting errors
1 parent bde894d commit 9515afc

37 files changed

+57
-26
lines changed

.pre-commit-config.yaml

+3-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
33
# Ruff version.
4-
rev: 'v0.2.0'
4+
rev: 'v0.2.1'
55
hooks:
66
- id: ruff
77
args: [--fix, --exit-non-zero-on-fix]
@@ -45,7 +45,7 @@ repos:
4545
args: [--no-strict-optional, --ignore-missing-imports]
4646
additional_dependencies: ["pydantic>2.0", "toml", "types-all"]
4747
- repo: https://github.com/jsh9/pydoclint
48-
rev: 0.3.9
48+
rev: 0.4.0
4949
hooks:
5050
- id: pydoclint
5151
args:
@@ -55,9 +55,6 @@ repos:
5555
hooks:
5656
- id: interrogate
5757
exclude: test.*
58-
- repo: https://github.com/python-jsonschema/check-jsonschema
59-
rev: 0.27.4
60-
hooks:
61-
- id: check-azure-pipelines
58+
6259
ci:
6360
autofix_prs: false

bumpversion/__main__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Main entrypoint for module."""
2+
23
from bumpversion.cli import cli
34

45
cli()

bumpversion/aliases.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Utilities for handling command aliases."""
2+
23
from typing import List, Optional
34

45
import rich_click as click

bumpversion/bump.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Version changing methods."""
2+
23
import shlex
34
from pathlib import Path
45
from typing import TYPE_CHECKING, ChainMap, List, Optional

bumpversion/cli.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""bump-my-version Command line interface."""
2+
23
from pathlib import Path
34
from typing import List, Optional
45

bumpversion/config/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Configuration management."""
2+
23
from __future__ import annotations
34

45
from typing import TYPE_CHECKING, Union

bumpversion/config/models.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Bump My Version configuration models."""
2+
23
from __future__ import annotations
34

45
import re

bumpversion/config/utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Helper functions for the config module."""
2+
23
from __future__ import annotations
34

45
import glob

bumpversion/exceptions.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Custom exceptions for BumpVersion."""
2+
23
from typing import Optional
34

45
from click import Context, UsageError

bumpversion/indented_logger.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""A logger adapter that adds an indent to the beginning of each message."""
2+
23
import logging
34
from contextvars import ContextVar
45
from typing import Any, MutableMapping, Optional, Tuple

bumpversion/show.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Functions for displaying information about the version."""
2+
23
import dataclasses
34
from io import StringIO
45
from pprint import pprint

bumpversion/ui.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Utilities for user interface."""
2+
23
import logging
34

45
import click

bumpversion/utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""General utilities."""
2+
23
import datetime
34
import string
45
from collections import ChainMap

bumpversion/version_part.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module for managing Versions and their internal parts."""
2+
23
import re
34
from typing import Any, Dict, List, MutableMapping, Optional, Tuple
45

bumpversion/versioning/conventions.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Standard version conventions."""
2+
23
from bumpversion.versioning.models import VersionComponentSpec, VersionSpec
34

45
# Adapted from https://packaging.python.org/en/latest/specifications/version-specifiers/

bumpversion/versioning/functions.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Generators for version parts."""
2+
23
import re
34
from typing import List, Optional, Union
45

bumpversion/versioning/models.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Models for managing versioning of software projects."""
2+
23
from __future__ import annotations
34

45
from collections import defaultdict, deque

bumpversion/versioning/serialization.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Functions for serializing and deserializing version objects."""
2+
23
import re
34
from copy import copy
45
from operator import itemgetter

bumpversion/visualize.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Visualize the bumpversion process."""
2+
23
from dataclasses import dataclass
34
from typing import List, Optional
45

bumpversion/yaml_dump.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""A simple YAML dumper to avoid extra dependencies."""
2+
23
import datetime
34
from collections import UserDict
45
from io import StringIO

docsrc/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
Sphinx configuration.
33
"""
4+
45
# flake8: noqa
56
import os
67
import sys

pyproject.toml

+19-20
Original file line numberDiff line numberDiff line change
@@ -147,22 +147,6 @@ color = true
147147
line-length = 119
148148

149149
[tool.ruff]
150-
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
151-
# "UP" "TRY" "PLR"
152-
select = ["E", "W", "F", "I", "N", "B", "BLE", "C", "D", "E", "F", "I", "N", "S", "T", "W", "RUF", "NPY", "PD", "PGH", "ANN", "C90", "PLC", "PLE", "PLW", "TCH"]
153-
ignore = [
154-
"ANN002", "ANN003", "ANN101", "ANN102", "ANN204", "ANN401",
155-
"S101", "S104",
156-
"D105", "D106", "D107", "D200", "D212",
157-
"PD011",
158-
"PLW1510",
159-
]
160-
161-
# Allow autofix for all enabled rules (when `--fix`) is provided.
162-
fixable = ["E", "W", "F", "I", "N", "B", "BLE", "C", "D", "E", "F", "I", "N", "S", "T", "W", "RUF", "NPY", "PD", "PGH", "ANN", "C90", "PL", "PLC", "PLE", "PLW", "TCH"]
163-
unfixable = []
164-
165-
# Exclude a variety of commonly ignored directories.
166150
exclude = [
167151
".bzr",
168152
".direnv",
@@ -189,22 +173,37 @@ exclude = [
189173
# Same as Black.
190174
line-length = 119
191175

176+
[tool.ruff.lint]
177+
select = ["E", "W", "F", "I", "N", "B", "BLE", "C", "D", "E", "F", "I", "N", "S", "T", "W", "RUF", "NPY", "PD", "PGH", "ANN", "C90", "PLC", "PLE", "PLW", "TCH"]
178+
ignore = [
179+
"ANN002", "ANN003", "ANN101", "ANN102", "ANN204", "ANN401",
180+
"S101", "S104",
181+
"D105", "D106", "D107", "D200", "D212",
182+
"PD011",
183+
"PLW1510",
184+
]
185+
186+
fixable = ["E", "W", "F", "I", "N", "B", "BLE", "C", "D", "E", "F", "I", "N", "S", "T", "W", "RUF", "NPY", "PD", "PGH", "ANN", "C90", "PL", "PLC", "PLE", "PLW", "TCH"]
187+
unfixable = []
188+
189+
# Exclude a variety of commonly ignored directories.
190+
192191
# Allow unused variables when underscore-prefixed.
193192
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
194193

195194
typing-modules = ["typing", "types", "typing_extensions", "mypy", "mypy_extensions"]
196195

197-
[tool.ruff.per-file-ignores]
196+
[tool.ruff.lint.per-file-ignores]
198197
"tests/*" = ["S101", "PLR0913", "PLR0915", "PGH003", "ANN001", "ANN202", "ANN201", "PLR0912", "TRY301", "PLW0603", "PLR2004", "ANN101", "S106", "TRY201", "ANN003", "ANN002", "S105", "TRY003"]
199198

200-
[tool.ruff.mccabe]
199+
[tool.ruff.lint.mccabe]
201200
# Unlike Flake8, default to a complexity level of 10.
202201
max-complexity = 10
203202

204-
[tool.ruff.isort]
203+
[tool.ruff.lint.isort]
205204
order-by-type = true
206205

207-
[tool.ruff.pydocstyle]
206+
[tool.ruff.lint.pydocstyle]
208207
convention = "google"
209208

210209
[tool.bumpversion]

tests/conftest.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Testing fixtures for Pytest."""
2+
23
import subprocess
34
from contextlib import contextmanager
45
from pathlib import Path

tests/test_autocast.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for the autocast module."""
2+
23
import pytest
34
from pytest import param
45

tests/test_bump.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for the bump module."""
2+
23
from pathlib import Path
34
from textwrap import dedent
45
from unittest.mock import MagicMock, patch

tests/test_cli/test_bump.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests the bump CLI subcommand."""
2+
23
import shutil
34
import subprocess
45
from datetime import datetime

tests/test_cli/test_replace.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for `bumpversion` package."""
2+
23
import shutil
34
import traceback
45
from pathlib import Path

tests/test_cli/test_show_bump.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests the show_bump command."""
2+
23
import shutil
34
from pathlib import Path
45

tests/test_config/test_create.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test the create function in the config module."""
2+
23
from pathlib import Path
34
import pytest
45

tests/test_config/test_files.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Test configuration parsing."""
2+
23
import difflib
34
import json
45
from pathlib import Path

tests/test_configuredfile.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for the ConfiguredFile class."""
2+
23
from bumpversion.files import ConfiguredFile, FileChange
34
from bumpversion.version_part import VersionConfig
45
from bumpversion.versioning.models import VersionComponentSpec

tests/test_files.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""File processing tests."""
2+
23
import os
34
import shutil
45
from datetime import datetime, timezone

tests/test_scm.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests of the VCS module."""
2+
23
import subprocess
34
from pathlib import Path
45

tests/test_utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for the utils module."""
2+
23
from itertools import combinations
34

45
import pytest

tests/test_versioning/test_serialization.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for the serialization of versioned objects."""
2+
23
from bumpversion.versioning.serialization import parse_version, serialize
34
from bumpversion.versioning.conventions import semver_spec, SEMVER_PATTERN
45
from bumpversion.versioning.models import Version, VersionSpec, VersionComponentSpec

tests/test_visualize.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests of the visualize module."""
2+
23
from pathlib import Path
34

45
from bumpversion.visualize import Border, BOX_CHARS, connection_str, lead_string, labeled_line, visualize

tests/test_yaml.py

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Tests for the yaml serialization module."""
2+
23
from pathlib import Path
34

45
from bumpversion import yaml_dump

0 commit comments

Comments
 (0)