summaryrefslogtreecommitdiffstats
path: root/pyproject.toml
diff options
context:
space:
mode:
Diffstat (limited to 'pyproject.toml')
-rw-r--r--pyproject.toml66
1 files changed, 66 insertions, 0 deletions
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..7b5a835
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,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",
+]