Repository navigation
Expand file tree
/
Copy pathruff.toml
More file actions
65 lines (55 loc) · 2.73 KB
/
Copy pathruff.toml
File metadata and controls
65 lines (55 loc) · 2.73 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
extend-exclude = [
# Generated build artifacts and output trees are not source.
"base/build",
"base/out",
# Imported upstream kernel tooling is maintained with the kernel sources.
# This does not exclude Azure Linux-owned tooling under scripts/ci/kernel.
"base/comps/kernel",
# Package sources may contain vendored or upstream Python code that we do
# not maintain as part of the repository's Python tooling.
"specs",
]
line-length = 120
target-version = "py312"
[lint]
select = ["ALL"] # Everything
ignore = [
# Intentional repository policy exceptions. Do not add cleanup debt here.
"COM812", # Conflicts with formatter.
"EM101", # One-use message variables add indirection to short, script-local exceptions.
"EM102", # Inline f-strings keep dynamic exception diagnostics beside their validation logic.
"S603", # Check for validation of input to subprocess calls, almost always a false positive
"S607", # Requiring abspath for all binaries used is very restrictive
"T201", # These scripts are fine to use `print` for output
"TRY003", # Domain-specific exception classes are excessive for script-local validation errors.
]
fixable = ["ALL"]
[lint.flake8-copyright]
notice-rgx = "(?m)^# Copyright \\(c\\) Microsoft Corporation\\.\\n# Licensed under the MIT License\\.$"
[lint.per-file-ignores]
"**/test_*.py" = ["S101"]
"**/*_test.py" = ["S101"]
# Pytest fixtures and helper modules use assertions as the framework's native
# expectation mechanism, even when their filenames do not match test patterns.
"**/tests/**/*.py" = ["S101"]
# The image-test cases are a pytest filesystem hierarchy, not importable
# packages, and use the repository-standard SPDX header without a separate
# copyright line. Only the sibling utils/ tree is packaged by pyproject.toml.
"base/images/tests/cases/**/*.py" = ["CPY001", "INP001"]
"base/images/tests/conftest.py" = ["INP001"]
# Helpers under scripts/ci/ are executed directly (python3 path/to/script.py)
# with sibling-module imports, not imported as a package, so they intentionally
# have no __init__.py. Silence the implicit-namespace-package rule for that tree.
"scripts/ci/**/*.py" = ["INP001"]
# These helpers and entry points are likewise used through direct execution
# with sibling imports rather than as importable packages.
"scripts/mcps/_mcp_utils.py" = ["INP001"]
"scripts/mcps/fedora-distgit-mcp.py" = ["INP001"]
"scripts/repo/_repo_layout.py" = ["INP001"]
"scripts/repo/_url_utils.py" = ["INP001"]
"scripts/repo/tests/**/*.py" = ["INP001"]
[lint.isort]
# Just force this, its better than dealing with a mishmash of modules that have annotations and those that don't
required-imports = ["from __future__ import annotations"]
[lint.pydocstyle]
convention = "google"