-
-
Notifications
You must be signed in to change notification settings - Fork 206
Expand file tree
/
Copy pathpyproject.toml
More file actions
168 lines (164 loc) · 4.75 KB
/
Copy pathpyproject.toml
File metadata and controls
168 lines (164 loc) · 4.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"
[project]
name = "json_repair"
version = "0.61.4"
license = "MIT"
license-files = ["LICENSE"]
authors = [
{ name="Stefano Baccianella", email="4247706+mangiucugna@users.noreply.github.com" },
]
description = "A package to repair broken json strings"
keywords = ["JSON", "REPAIR", "LLM", "PARSER"]
readme = "README.md"
requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
]
[project.urls]
"Homepage" = "https://github.com/mangiucugna/json_repair/"
"Bug Tracker" = "https://github.com/mangiucugna/json_repair/issues"
"Live demo" = "https://mangiucugna.github.io/json_repair/"
[project.optional-dependencies]
# Skip Rust-backed schema extras on Python 3.15 prereleases until upstream wheels land.
schema = [
"jsonschema>=4.21; python_full_version < '3.15.0a0' or python_full_version >= '3.15.0'",
"pydantic>=2; python_full_version < '3.15.0a0' or python_full_version >= '3.15.0'",
]
[dependency-groups]
dev = [
{ include-group = "schema" },
{ include-group = "test" },
{ include-group = "typecheck" },
"pre-commit",
]
schema = [
"jsonschema",
"pydantic",
]
test = [
"coverage",
"pytest",
"pytest-benchmark",
]
typecheck = [
"mypy",
"ty",
]
[tool.pytest.ini_options]
pythonpath = [
"."
]
[tool.coverage.run]
source = ["src"]
omit = [
"*/.cursor/extensions/*",
"*/pythonFiles/lib/python/*",
"*/site-packages/*",
"src/json_repair/__main__.py",
]
[tool.coverage.report]
include = [
"src/json_repair/*",
]
exclude_also = [
'def __repr__',
'if self.debug:',
'if settings.DEBUG',
'raise AssertionError',
'raise NotImplementedError',
'if 0:',
'if __name__ == .__main__.:',
'if TYPE_CHECKING:',
'class .*\bProtocol\):',
'@(abc\.)?abstractmethod',
]
[tool.setuptools.package-data]
"json_repair" = ["py.typed"]
[tool.setuptools.packages.find]
where = ["src"]
[project.scripts]
json_repair = "json_repair.__main__:cli"
[tool.ruff]
# Same as Black.
indent-width = 4
line-length = 120
# Assume Python 3.13
target-version = "py313"
[tool.ruff.lint]
# Read more here https://docs.astral.sh/ruff/rules/
# By default, Ruff enables Flake8's E and F rules
# FastAPI - FAST
# Flake8-no-pep420 - INP
# Flake8-bandit - S
# Flake8-bugbear – catches real-world Python footguns - B
# Flake8-builtins - A
# Flake8-comprehensions - C4
# Flake8-blind-except - BLE
# Flake8-commas - COM
# Flake8-implicit-str-concat - ISC
# Flake8-print - T20
# Flake8-quotes - Q
# Flake8-raise - RSE
# Flake8-return - RET
# Flake8-tidy-imports - TID
# Flake8-type-checking - TC
# Flake8-unused-arguments - ARG
# Refurb - FURB
# Isort - I
# Mccabe – code complexity warnings - C90
# PEP 8 Naming convention - N
# Perflint - PERF
# Pygrep-hooks - PGH
# flake8-pie - PIE
# Flake8-use-pathlib - PTH
# Pycodestyle - E, W
# Pyflakes - F
# Pylint - PLC, PLE, PLR, PLW
# PyTest - PT
# Pyupgrade – safe modernization (e.g., str() → f"") - UP
# Ruff specific - RUF
# Simplifications (e.g., if x == True → if x) - SIM
select = ['A', 'ARG', 'B', 'BLE', 'C4', 'COM', 'C90', 'E', 'F', 'FURB', 'I', 'INP', 'ISC', 'N', 'PERF', 'PGH', 'PIE', 'PLC', 'PLE', 'PLW', 'PT', 'PTH', 'Q', 'RET', 'RSE', 'S', 'SIM', 'T20', 'TC', 'TID', 'UP', 'W']
# Only enable these RUF rules
extend-select = [
"RUF001", # ambiguous Unicode
"RUF100", # unused noqa
"RUF012", # mutable default arguments
"RUF013", # unnecessary super()
"RUF016", # unnecessary else after return (optional)
"RUF018", # unnecessary else after raise (optional)
"RUF005", # avoid list concatenation in membership checks
"RUF010", # prefer explicit conversion flags in f-strings
"RUF019", # prefer dict.get over redundant key checks
"RUF022", # keep __all__ sorted
"RUF043", # make pytest.raises regex intent explicit
"TRY300", # keep returns out of try blocks
]
ignore = [
"S101", # assert: Use of assert detected. We like assert
"COM812", # Ruff: The following rule may cause conflicts when used with the formatter
"E501", # Line too long
"C901", # `function` is too complex
]
# Allow fix for all enabled rules (when `--fix`) is provided.
fixable = ["ALL"]
unfixable = []
[tool.ruff.format]
# Like Black, use double quotes for strings.
quote-style = "double"
# Like Black, indent with spaces, rather than tabs.
indent-style = "space"
# Like Black, respect magic trailing commas.
skip-magic-trailing-comma = false
# Like Black, automatically detect the appropriate line ending.
line-ending = "auto"
[tool.ruff.lint.per-file-ignores]
# Explicit re-exports is fine in __init__.py, still a code smell elsewhere.
"__init__.py" = ["PLC0414"]
"src/json_repair/json_repair.py" = ["T201"]
"tests/profiler.py" = ["T201"]
[tool.mypy]
strict = true