-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathpyproject.toml
More file actions
248 lines (226 loc) · 7.7 KB
/
pyproject.toml
File metadata and controls
248 lines (226 loc) · 7.7 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
244
245
246
247
248
[project]
name = "robotframework-robocop"
description = "Static code analysis tool (linter) and code formatter for Robot Framework"
readme = "README.md"
authors = [
{ name = "Bartlomiej Hirsz", email = "bartek.hirsz@gmail.com" },
{ name = "Mateusz Nojek", email = "matnojek@gmail.com" },
]
maintainers = [
{ name = "Bartlomiej Hirsz", email = "bartek.hirsz@gmail.com" },
]
requires-python = ">=3.10"
dependencies = [
"jinja2>=3.1.4",
"robotframework>=5.0,<7.5",
"typer>=0.12.5",
"rich>=10.11.0",
"tomli==2.2.1; python_version < '3.11'",
"tomli-w>=1.0",
"pathspec>=0.12",
"platformdirs>=4.3",
"pytz>=2022.7",
"msgpack>=1.0.0",
"typing-extensions>=4.15.0",
]
keywords = ["robotframework", "automation", "testautomation", "testing", "linter", "qa", "formatting", "formatter"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Framework :: Robot Framework",
"Framework :: Robot Framework :: Tool",
"Topic :: Software Development :: Testing",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Utilities",
"Intended Audience :: Developers"
]
dynamic = ["version"]
[project.scripts]
robocop = "robocop.run:main"
robocop-mcp = "robocop.mcp.server:main"
[project.optional-dependencies]
mcp = [
"fastmcp>=2.13.0,<3"
]
[project.urls]
"Bug tracker" = "https://github.com/MarketSquare/robotframework-robocop/issues"
"Source code" = "https://github.com/MarketSquare/robotframework-robocop"
Documentation = "https://robocop.dev/"
Homepage = "https://robocop.dev/"
[build-system]
requires = ["hatchling>=1.26.1"]
build-backend = "hatchling.build"
[tool.hatch.build.targets.wheel]
packages = ["src/robocop"]
[tool.hatch.version]
path = "src/robocop/__init__.py"
[tool.uv]
default-groups = ["dev", "doc"]
[dependency-groups]
dev = [
"robotframework-robocop[mcp]",
"coverage>=7.6.4",
"pytest>=8.3.3",
"pytest-xdist>=3.6.1",
"ruff==0.14.8",
"pysonar",
"nox>=2025.11.12",
"packaging>=25.0",
"mypy>=1.19.1",
"types-jinja2",
"types-pytz",
"msgpack-types"
]
doc = [
"mkdocs",
"mkdocs-material",
"mkdocs-gen-files",
"mkdocs-git-authors-plugin",
"mkdocs-macros-plugin",
"mkdocs-redirects>=1.2.2",
]
mcp = [
"fastmcp>=2.13.0",
]
[tool.ruff]
line-length = 120
show-fixes = true
target-version = "py310"
lint.select = [
"ALL", # include all the rules, including new ones
]
lint.ignore = [
#### modules
"DJ", # django
"PD", # pandas
"PTH", # flake8-use-pathlib
#### specific rules
##### Will not fix - style choice
"D100", # missing docstring in public module
"D101", # missing docstring in public class
"D102", # missing docstring in public method
"D103", # missing docstring in public function
"D104", # missing docstring in public package
"D105", # missing docstring in magic method
"D107", # missing docstring in __init__
"D203", # blank line before class
"D212", # multi-line docstring summary should start at the first line
"D400", # first line should end with a period
"D415", # first line should end with period, question mark or exlamation point
"EM102", # exception with fstring
"TD002", # 'to do' without author
"TD003", # missing issue link with TODO
"COM812", # trailing commas - if we add, it will not split anymore
"EM101", # exception with string literal
"FBT001", # Boolean-typed positional argument in function definition
"FBT002", # Boolean-typed positional argument in function definition
"PLR2004", # magic value in comparison
"TRY003", # long message outside the exception class
"N999", # invalid module names (CamelCase instead of snake_case) - Robot compatibility
"T201", # print in code
#### Fix or decrease
"ERA001", # commented-out code
#"ANN204", # missing type annotation for __init__
"FIX002", # code with to do - check all of them later
"PERF203", # try except in for loop - check all of them for possible refactors
"C901", # code too complex (duplicate with other rules)
"SIM108", # ternary operator - reconsider, sometimes the code readability is lower with ternary
"TD005", # empty TODO
"FIX001", # line with fixme
"TD001", # invalid todo tag fixme
"TD004", # missing colon in TODO
#"ANN001", # annotations in method
#"ANN002", # annotations in return type
#"ANN201", # annotations in return type
#"ANN205", # annotations in return type
"RUF012", # mutable class attributes should be annotated with `typing.ClassVar`
"PLR0913", # too many arguments in function definition
"PLW2901", # for loop variable overwritten
"INP001", # part of namespace package
"PLR0912", # too many branches TODO
#"ANN003", # missing type kwargs
"SIM105", # contexlib.supress
"ANN401", # typing.Any
"B028", # no implicit stacklevel
"N818", # exception with Error suffix
"TRY301", # abstract raise to an inner function
]
lint.unfixable = [
# PT022 replace empty `yield` to empty `return`. Might be fixed with a combination of PLR1711
# In addition, it can't do anything with invalid typing annotations, protected by mypy.
"PT022",
]
extend-exclude = [
"tests/linter/test_data/",
"docs/"
]
[tool.ruff.lint.extend-per-file-ignores]
"tests/*" = [
"ANN", # no typing for tests for now
"PLR0913" , # too many arguments in function definition
"S101" # asserts
]
# MCP module uses lazy imports for optional dependency isolation
"src/robocop/mcp/*" = [
"PLC0415", # import at function level for lazy loading
"PERF401", # list comprehension vs for loop is style choice
"TRY300", # return in try block is fine here
"TC001", # Pydantic models need runtime import for schema generation
"PLR0915", # register_tools has many statements by design
]
# temporary because of the rules description
"src/robocop/linter/rules/*" = [
"D205",
"D412", # no black lines after a section header - it is messing up our docs when enabled
]
# bug in typer where | None can't be used
"src/robocop/run.py" = ["RUF013"]
[tool.ty.src]
include = ["src"]
[tool.coverage.run]
omit = ["*tests*"]
source = ["robocop"]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"if __name__ == .__main__.:",
"raise NotImplementedError"
]
fail_under = 5
[tool.mypy]
python_version = "3.10"
strict = true
warn_return_any = true
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_unreachable = true
# Error output formatting
show_error_codes = true
show_column_numbers = true
pretty = true
color_output = true
# Module discovery
mypy_path = "src"
packages = ["robocop"]
exclude = ["tests/", "docs/"]
# Robot Framework - no type stubs available for all supported versions
[[tool.mypy.overrides]]
module = "robot.*"
ignore_missing_imports = true
# External libraries that may have incomplete stubs or no stubs at all
[[tool.mypy.overrides]]
module = ["typer.*", "click.*", "rich.*", "rich_click.*", "platformdirs.*", "tomli.*", "tomli_w.*", "jinja2.*"]
ignore_missing_imports = true
# CLI module - intentionally passes None values to dataclasses which are handled by overwrite()
# Also uses untyped decorators from typer/click and subclasses from Any-typed base classes
[[tool.mypy.overrides]]
module = "robocop.run"
disable_error_code = ["arg-type", "attr-defined", "unused-ignore", "misc"]