mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02:00
This changes will introduce [flake8-annotations (ANN)](https://docs.astral.sh/ruff/rules/#flake8-annotations-ann) for python type annotation, this will make all thing related to function strictly typed in python This rule will start to affected this directory from now: - /python -> Root directory - /python/tidy - /python/wpt Testing: `./mach test-tidy` Fixes: Not related to any issues --------- Signed-off-by: Jerens Lensun <jerensslensun@gmail.com>
65 lines
1.3 KiB
TOML
65 lines
1.3 KiB
TOML
[tool.ruff]
|
|
line-length = 120
|
|
extend-exclude = [
|
|
# temporary local files
|
|
"target/**",
|
|
"__pycache__/**",
|
|
"python/_venv*/**",
|
|
# upstream
|
|
"third_party/**",
|
|
"python/mach/**",
|
|
"components/**",
|
|
"tests/**",
|
|
]
|
|
|
|
[tool.ruff.lint]
|
|
select = [
|
|
"E",
|
|
"W",
|
|
"F",
|
|
# Type Annotation
|
|
"ANN",
|
|
]
|
|
ignore = [
|
|
# Trailing whitespace; the standard tidy process will enforce no trailing whitespace
|
|
"W291",
|
|
# 80 character line length; the standard tidy process will enforce line length
|
|
"E501",
|
|
# allow Any type
|
|
"ANN401",
|
|
]
|
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
"!python/**/**.py" = ["ANN"]
|
|
"python/servo/**.py" = ["ANN"]
|
|
"**/test.py" = ["ANN"]
|
|
"**/*_tests.py" = ["ANN"]
|
|
"**/tests/**/*.py" = ["ANN"]
|
|
|
|
[tool.pyrefly]
|
|
search-path = [
|
|
"python",
|
|
"tests/wpt/tests",
|
|
"tests/wpt/tests/tools",
|
|
"tests/wpt/tests/tools/wptrunner",
|
|
"tests/wpt/tests/tools/wptserve",
|
|
"python/mach",
|
|
"python/wpt",
|
|
"third_party/WebIDL",
|
|
"components/script_bindings/codegen",
|
|
]
|
|
project-includes = [
|
|
"python/**/*.py",
|
|
"components/script_bindings",
|
|
]
|
|
project-excludes = [
|
|
"**/venv/**",
|
|
"**/.venv/**",
|
|
"tests/wpt/tests/**",
|
|
"**/test.py",
|
|
"**/*_tests.py",
|
|
"**/tests/**",
|
|
"python/mach/**/*.py",
|
|
"python/servo/mutation/**/*.py",
|
|
]
|