aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/pyproject.toml
diff options
context:
space:
mode:
author简律纯 <i@jyunko.cn>2024-02-24 13:04:40 +0800
committer简律纯 <i@jyunko.cn>2024-02-24 13:04:40 +0800
commit57b2835ecc6c9b30920e929985b9d7cafcb7c457 (patch)
treedf0c1221d4766365c231e8bd02e6d8e7bdb63420 /pyproject.toml
parent45e2f3631bc8d13dacba57e705c7591e7e707b2a (diff)
downloadTRPGNivis-57b2835ecc6c9b30920e929985b9d7cafcb7c457.tar.gz
TRPGNivis-57b2835ecc6c9b30920e929985b9d7cafcb7c457.zip
chore(project): add ruff deps
chore(lint): format code with ruff chore(project): add tool.ruff format section
Diffstat (limited to 'pyproject.toml')
-rw-r--r--pyproject.toml84
1 files changed, 73 insertions, 11 deletions
diff --git a/pyproject.toml b/pyproject.toml
index 16df8fe..79925d4 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -2,19 +2,11 @@
name = "nivis-python"
version = "0.1.0"
description = "Python implementation for Nivis."
-authors = [
- {name = "简律纯", email = "i@jyunko.cn"},
-]
-dependencies = [
- "ply>=3.11",
-]
+authors = [{ name = "简律纯", email = "i@jyunko.cn" }]
+dependencies = ["ply>=3.11"]
requires-python = ">=3.11"
readme = "README.rst"
-license = {text = "MIT"}
-
-[build-system]
-requires = ["pdm-backend"]
-build-backend = "pdm.backend"
+license = { text = "MIT" }
[tool.pdm.dev-dependencies]
docs = [
@@ -26,3 +18,73 @@ docs = [
"sphinx-design>=0.5.0",
"sphinx-intl>=2.1.0",
]
+lint = [
+ "ruff>=0.2.2",
+]
+
+[tool.ruff]
+# Exclude a variety of commonly ignored directories.
+exclude = [
+ ".bzr",
+ ".direnv",
+ ".eggs",
+ ".git",
+ ".git-rewrite",
+ ".hg",
+ ".ipynb_checkpoints",
+ ".mypy_cache",
+ ".nox",
+ ".pants.d",
+ ".pyenv",
+ ".pytest_cache",
+ ".pytype",
+ ".ruff_cache",
+ ".svn",
+ ".tox",
+ ".venv",
+ ".vscode",
+ "__pypackages__",
+ "_build",
+ "buck-out",
+ "build",
+ "dist",
+ "node_modules",
+ "site-packages",
+ "venv",
+]
+
+# Same as Black.
+line-length = 88
+indent-width = 4
+
+# Assume Python 3.8
+target-version = "py38"
+
+[tool.ruff.lint]
+# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
+select = ["E4", "E7", "E9", "F"]
+ignore = []
+
+# Allow fix for all enabled rules (when `--fix`) is provided.
+fixable = ["ALL"]
+unfixable = []
+
+# Allow unused variables when underscore-prefixed.
+dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
+
+[tool.ruff.format]
+# Like Black, use double quotes for strings.
+quote-style = "double"
+
+# Like Black, indent with spaces, rather than tabs.
+indent-style = "space"
+
+# Like Black, respect magic trailing commas.
+skip-magic-trailing-comma = false
+
+# Like Black, automatically detect the appropriate line ending.
+line-ending = "auto"
+
+[build-system]
+requires = ["pdm-backend"]
+build-backend = "pdm.backend"