Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13" ]
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14" ]

steps:
- uses: actions/checkout@v2
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest pytest-cov ruff==0.11.8
python -m pip install pytest pytest-cov ruff==0.14.10
python -m pip install -e .
- name: Format check
run: |
Expand Down
6 changes: 3 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ name = "pypi"
string_gen = { editable = true, path = "." }

[dev-packages]
pytest = "==8.3.5"
pytest-cov = "==6.1.1"
ruff = "==0.11.8"
pytest = "==9.0.2"
pytest-cov = "==7.0.0"
ruff = "==0.14.10"

[requires]
python_version = "3.12"
Expand Down
72 changes: 71 additions & 1 deletion ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,74 @@ select = [
"FLY", # flynt
"PL", # Pylint
"RSE", # flake8-raise
"ERA", # eradicate (Закомменченый код)
"BLE", # flake8-blind-except
"FBT", # flake8-boolean-trap
"DTZ", # flake8-datetimez
"INT", # flake8-gettext
"TC", # flake8-type-checking
"W", # pycodestyle (warning)
"PLR", # Refactor
"PLW", # Warning
"TRY", # Warning
"ASYNC", # flake8-async
"T10", # flake8-debugger
"EM", # flake8-errmsg
"EXE", # flake8-executable
"LOG", # flake8-logging
"G", # flake8-logging-format
"SLF", # flake8-self
"SLOT", # flake8-slots
"TID", # flake8-tidy-imports
"PLE", # Pylint Error "A", # flake8-builtins
"ANN", # flake8-annotations
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"COM", # flake8-commas
"D", # pydocstyle
"E", # pycodestyle
"F", # Pyflakes
"FURB", # refurb
"I", # isort
"ICN", # flake8-import-conventions
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming
"PERF", # Perflint
"PGH", # pygrep-hooks
"PTH", # flake8-use-pathlib
"RUF", # Ruff-specific rules
"S", # flake8-bandit
"T20", # flake8-print
"UP", # pyupgrade
"PIE", # flake8-pie
"PT", # flake8-pytest-style
"Q", # flake8-quotes
"RET", # flake8-return
"SIM", # flake8-simplify
"ARG", # flake8-unused-arguments
"FLY", # flynt
"PL", # Pylint
"RSE", # flake8-raise
"ERA", # eradicate (Закомменченый код)
"BLE", # flake8-blind-except
"FBT", # flake8-boolean-trap
"DTZ", # flake8-datetimez
"INT", # flake8-gettext
"TC", # flake8-type-checking
"W", # pycodestyle (warning)
"PLR", # Refactor
"PLW", # Warning
"TRY", # Warning
"ASYNC", # flake8-async
"T10", # flake8-debugger
"EM", # flake8-errmsg
"EXE", # flake8-executable
"LOG", # flake8-logging
"G", # flake8-logging-format
"SLF", # flake8-self
"SLOT", # flake8-slots
"TID", # flake8-tidy-imports
"PLE", # Pylint Error
]
ignore = [
"D105", # Missing docstring in magic method
Expand All @@ -43,10 +111,12 @@ ignore = [
"D203", # one-blank-line-before-class (conflicts rules)
"COM812", # conflicts rules
"ISC001", # conflicts rules
"TRY003", # Avoid specifying long messages outside the exception class
"EM102", # Exception must not use an f-string literal, assign to variable first
]

[lint.per-file-ignores]
"test_*.py" = ["S101", "D103", "ANN201", "PLR2004"]
"test_*.py" = ["S101", "D103", "ANN201", "PLR2004", "FBT001"]

[lint.flake8-pytest-style]
parametrize-values-row-type = "tuple"
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Testing",
Expand Down
4 changes: 2 additions & 2 deletions string_gen/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def value(self, pattern: re.Pattern) -> str:
}


class StringGen:
class StringGen: # noqa: PLW1641
"""Base class for generating strings."""

__slots__ = ("_parser", "_pattern")
Expand All @@ -122,7 +122,7 @@ def pattern(self) -> re.Pattern:

def __get_value(self, value: Any) -> re.Pattern:
if isinstance(value, type(self)):
return value._pattern
return value._pattern # noqa: SLF001
if isinstance(value, re.Pattern):
return value
if isinstance(value, (str, bytes)):
Expand Down