summaryrefslogtreecommitdiffstats
path: root/pyproject.toml
blob: 7b5a8358fb90ec8abeeb9e287120c0f85b4d09d9 (plain)
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
[tool.ruff]
target-version = "py37"
select = [
    "E",  # pycodestyle errors
    "W",  # pycodestyle warnings
    "F",  # pyflakes
    "C",  # flake8-comprehensions
    "T",  # Print.
    "I",  # isort
    # "B",  # flake8-bugbear
    "UP",  # pyupgrade
    "RUF100",  # unused-noqa
    "Q", # quotes
]
ignore = [
    "E501",  # Line too long, handled by black
    "C901",  # Too complex
    "E731",  # Assign lambda.
    "E402", # Module level import not at the top.
    "E741", # Ambiguous variable name.
]


[tool.ruff.per-file-ignores]
"examples/*" = ["T201"]  # Print allowed in examples.
"src/prompt_toolkit/application/application.py" = ["T100", "T201", "F821"]  # pdb and print allowed.
"src/prompt_toolkit/contrib/telnet/server.py" = ["T201"]  # Print allowed.
"src/prompt_toolkit/key_binding/bindings/named_commands.py" = ["T201"]  # Print allowed.
"src/prompt_toolkit/shortcuts/progress_bar/base.py" = ["T201"]  # Print allowed.
"tools/*" = ["T201"]  # Print allowed.
"src/prompt_toolkit/filters/__init__.py" = ["F403", "F405"]  # Possibly undefined due to star import.
"src/prompt_toolkit/filters/cli.py" = ["F403", "F405"]  # Possibly undefined due to star import.
"src/prompt_toolkit/shortcuts/progress_bar/formatters.py" = ["UP031"] # %-style formatting.


[tool.ruff.isort]
known-first-party = ["prompt_toolkit"]
known-third-party = ["pygments", "asyncssh"]

[tool.typos.default]
extend-ignore-re = [
    "Formicidae",
    "Iterm",
    "goes",
    "iterm",
    "prepend",
    "prepended",
    "prev",
    "ret",
    "rouble",
    "x1b\\[4m",
    # Deliberate spelling mistakes in autocorrection.py
    "wolrd",
    "impotr",
    # Lorem ipsum.
    "Nam",
    "varius",
]

locale = 'en-us'  # US English.

[tool.typos.files]
extend-exclude = [
    "tests/test_cli.py",
    "tests/test_regular_languages.py",
]