-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathpyproject.toml
More file actions
243 lines (215 loc) · 7.18 KB
/
pyproject.toml
File metadata and controls
243 lines (215 loc) · 7.18 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
[project]
name = "lgtm-ai"
version = "0.9.1"
description = "Your AI-powered code review companion"
authors = [
{name = "Sergio Castillo Lara", email = "s.cast.lara@gmail.com"},
{name = "Jakub Bożanowski", email= "jakub@bozanowski.eu"}
]
requires-python = ">=3.12,<4"
readme = "README.md"
keywords = [
"AI",
"code-review",
"linting",
"static-analysis",
"machine-learning",
"developer-tools",
"automation"
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Code Generators",
"Topic :: Utilities",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: OS Independent"
]
dependencies = [
"click>=8.1.7,<9.0.0",
"pydantic-ai>=0.1.12",
"pydantic>=2.10.3,<3.0.0",
"python-gitlab>=5.1.0,<6.0.0",
"rich>=13.9.4,<14.0.0",
"pygithub>=2.6.1,<3.0.0",
"httpx (>=0.28.1,<0.29.0)",
"jinja2 (>=3.1.6,<4.0.0)"
]
[tool.poetry.group.dev.dependencies]
pytest = "*"
mypy = "*"
ruff = "*"
pytest-cov = "*"
ipdb = "*"
commitizen = "*"
mkdocs-material = "*"
codespell = "*"
pre-commit = "*"
[project.scripts]
lgtm = "lgtm_ai.__main__:entry_point"
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
[tool.pytest.ini_options]
addopts = """
-s
--cov
--cov-report term-missing
--cov-report=xml:./tests/coverage.xml
--junitxml=./tests/junit.xml
"""
filterwarnings = [
"ignore:Pydantic serializer warnings:UserWarning",
"ignore:There is no current event loop:DeprecationWarning"
]
[tool.ruff]
target-version = "py312"
line-length = 120
src = ["src", "tests"]
[tool.ruff.lint]
select = [
"C9", # mccabe
"E", # pycodestyle error
"W", # pycodestyle warning
"F", # pyflakes
"B", # bugbear
"D", # pydocstyle
"I", # isort
"C4", # comprehensions
"SIM", # simplify
"N", # pep8-naming
"TRY", # tryceratops
"UP", # pyupgrade
"PT", # pytest-style
"ANN", # annotations
"S", # bandit
]
ignore = [
'D1', # pydocstyle enforcement of docstrings everywhere
'TRY003', # tryceratops too noisy
'TRY400', # we don't necessarily want to expose exceptions through logging
"E501", # line length (black handles it)
"COM812", # may cause conflicts when used with the formatter
]
[tool.ruff.lint.mccabe]
max-complexity = 10
[tool.ruff.lint.pydocstyle]
convention = "pep257"
[tool.ruff.lint.isort]
known-third-party = ["lgtm_ai", "tests"]
[tool.ruff.lint.per-file-ignores]
"tests/*" = [
"ANN", # no enforcement of type annotations in tests
"S", # bandit is not useful in tests
]
[tool.mypy]
python_version = "3.12"
mypy_path = "src"
strict = true # strict type checking.
warn_no_return = false # allow functions without explicit return.
pretty = true # show error messages in a readable format.
[tool.twyn]
allowlist = [
"fasta2a"
]
[tool.coverage.run]
source = ["src"]
omit = ["tests/*"]
[tool.coverage.report]
fail_under = 90
exclude_lines = [
"if TYPE_CHECKING:",
"pragma: no cover",
"raise NotImplementedError",
]
[tool.commitizen]
version_files = ["pyproject.toml:^version"]
name = "cz_customize"
version = "0.9.1"
tag_format = "v$version"
[tool.commitizen.customize]
message_template = "{{prefix}}{% if scope %}({{scope}}){% endif %}: {{subject}}{% if body %}\n\n{{body}}{% endif %}{% if is_breaking_change %}\n\nBREAKING CHANGE: {{footer}}{% else %}\n\n{{footer}}{% endif %}"
bump_pattern = "^(BREAKING[\\-\\ ]CHANGE|feat|fix|refactor|perf|ci|docs|style|test|chore|revert|build)(\\(.+\\))?(!)?"
change_type_order = [
"BREAKING CHANGE",
"Feat",
"Fix",
"Refactor",
"Perf",
"CI",
"Docs",
"Technical",
"Tests",
]
bump_message = "bump: version $current_version → $new_version"
schema = "<type>(<scope>): <subject>\n<BLANK LINE>\n<body>\n<BLANK LINE>\n(BREAKING CHANGE: )<footer>"
schema_pattern = "(?s)(build|ci|docs|feat|fix|perf|refactor|style|test|chore|revert|bump)(\\(\\S+\\))?!?:( [^\\n\\r]+)((\\n\\n.*)|(\\s*))?$"
commit_parser = "^(?P<change_type>feat|fix|refactor|perf|BREAKING CHANGE|ci|docs|style|test|chore|revert|build)(?:\\((?P<scope>[^()\\r\\n]*)\\)|\\()?(?P<breaking>!)?:\\s(?P<message>.*)?"
version_parser = "(?P<version>([0-9]+)\\.([0-9]+)\\.([0-9]+)(?:-([0-9A-Za-z-]+(?:\\.[0-9A-Za-z-]+)*))?(?:\\+[0-9A-Za-z-]+)?(\\w+)?)"
changelog_pattern = "^(BREAKING[\\-\\ ]CHANGE|feat|fix|refactor|perf|ci|docs|style|test|chore|revert|build)(\\(.+\\))?(!)?" # same as bump_pattern
[tool.commitizen.customize.bump_map]
"^.+!$" = "MAJOR"
"^BREAKING[\\-\\ ]CHANGE" = "MAJOR"
"^feat" = "MINOR"
"^fix" = "PATCH"
"^refactor" = "PATCH"
"^perf" = "PATCH"
"^ci" = "PATCH"
"^docs" = "PATCH"
"^style" = "PATCH"
"^test" = "PATCH"
"^chore" = "PATCH"
"^revert" = "PATCH"
"^build" = "PATCH"
[tool.commitizen.customize.change_type_map]
"feat" = "Feat"
"fix" = "Fix"
"refactor" = "Refactor"
"perf" = "Perf"
"ci" = "CI"
"docs" = "Docs"
"style" = "Technical"
"test" = "Tests"
"chore" = "Technical"
"revert" = "Fix"
"build" = "Technical"
[[tool.commitizen.customize.questions]]
type = "list"
name = "prefix"
message = "Select the type of change you are committing"
choices = [
{ value = "fix", name = "fix: A bug fix. Correlates with PATCH in SemVer", key = "x" },
{ value = "feat", name = "feat: A new feature. Correlates with MINOR in SemVer", key = "f" },
{ value = "docs", name = "docs: Documentation only changes", key = "d" },
{ value = "style", name = "style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)", key = "s" },
{ value = "refactor", name = "refactor: A code change that neither fixes a bug nor adds a feature", key = "r" },
{ value = "perf", name = "perf: A code change that improves performance", key = "p" },
{ value = "test", name = "test: Adding missing or correcting existing tests", key = "t" },
{ value = "build", name = "build: Changes that affect the build system or external dependencies (example scopes: pip, docker, npm)", key = "b" },
{ value = "ci", name = "ci: Changes to our CI configuration files and scripts (example scopes: GitLabCI)", key = "c" },
]
[[tool.commitizen.customize.questions]]
type = "input"
name = "scope"
message = "What is the scope of this change? ((story number, class or file name): (press [enter] to skip)\n"
[[tool.commitizen.customize.questions]]
type = "input"
name = "subject"
message = "Write a short and imperative summary of the code changes: (lower case and no period)\n"
[[tool.commitizen.customize.questions]]
type = "input"
name = "body"
message = "Provide additional contextual information about the code changes: (press [enter] to skip)\n"
[[tool.commitizen.customize.questions]]
type = "confirm"
message = "Is this a BREAKING CHANGE? Correlates with MAJOR in SemVer"
name = "is_breaking_change"
default = false
[[tool.commitizen.customize.questions]]
type = "input"
name = "footer"
message = "Footer. Information about Breaking Changes and reference issues that this commit closes: (press [enter] to skip)\n"