From 5d34a7b3371b4fc176937ca13f7c590811a0aec7 Mon Sep 17 00:00:00 2001 From: jorenham Date: Tue, 8 Oct 2024 16:22:20 +0200 Subject: [PATCH] use 4-space indentation for toml --- .editorconfig | 11 ++-- pyproject.toml | 142 ++++++++++++++++++++++++------------------------- 2 files changed, 72 insertions(+), 81 deletions(-) diff --git a/.editorconfig b/.editorconfig index 3480f065..bf010252 100644 --- a/.editorconfig +++ b/.editorconfig @@ -2,18 +2,13 @@ root = true -# Unix-style newlines with a newline ending every file [*] charset = utf-8 end_of_line = lf -insert_final_newline = true +indent_size = 4 indent_style = space +insert_final_newline = true trim_trailing_whitespace = true -# 4 space indentation -[*.{py,pyi,md}] -indent_size = 4 - -# 2 space indentation -[*.{json,jsonc,yml,yaml,toml}] +[*.{json,jsonc,yml,yaml}] indent_size = 2 diff --git a/pyproject.toml b/pyproject.toml index 88fa3296..8edf3444 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,19 +2,18 @@ build-backend = "poetry.core.masonry.api" requires = ["poetry-core"] - [tool.poetry] authors = ["Joren Hammudoglu "] classifiers = [ - "Development Status :: 3 - Alpha", - "Operating System :: OS Independent", - "Topic :: Scientific/Engineering", - "Typing :: Stubs Only", - "Typing :: Typed", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3.13", + "Development Status :: 3 - Alpha", + "Operating System :: OS Independent", + "Topic :: Scientific/Engineering", + "Typing :: Stubs Only", + "Typing :: Typed", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", ] description = "Type stubs for SciPy" documentation = "https://github.com/jorenham/scipy-stubs?tab=readme-ov-file#scipy-stubs" @@ -49,10 +48,10 @@ type = "poetry" [tool.poe.tasks] clean = """ rm -rf - scipy-stubs/**/*.pyc - scipy-stubs/**/__pycache__ - ./**/.mypy_cache - ./**/.ruff_cache + scipy-stubs/**/*.pyc + scipy-stubs/**/__pycache__ + ./**/.mypy_cache + ./**/.ruff_cache """ lint = "ruff check" @@ -77,13 +76,12 @@ args = [{name = "path", positional = true, multiple = true, default = ""}] [tool.poe.tasks.stubtest] cmd = """ stubtest - --mypy-config-file=pyproject.toml - --allowlist=tests/stubtest/allowlist.txt - $modules + --mypy-config-file=pyproject.toml + --allowlist=tests/stubtest/allowlist.txt + $modules """ args = [{name = "modules", positional = true, multiple = true, default = "scipy"}] - [tool.mypy] python_version = "3.10" strict = true @@ -94,7 +92,6 @@ disallow_untyped_defs = false # TODO disallow_incomplete_defs = false # TODO warn_unused_ignores = true - [tool.pyright] include = ["scipy-stubs", "typetests"] exclude = [".cache"] @@ -115,7 +112,6 @@ reportPrivateUsage = false reportUnnecessaryTypeIgnoreComment = true reportUnsafeMultipleInheritance = true - [tool.ruff] builtins = ["reveal_locals", "reveal_type"] exclude = ["scipy-pyright", ".venv"] @@ -131,61 +127,61 @@ skip-magic-trailing-comma = false [tool.ruff.lint] ignore = [ - "E741", - "COM812", # ruff format compat - "ANN", # TODO - "PYI054", # numeric-literal-too-long + "ANN", # TODO + "E741", + "COM812", # ruff format compat + "PYI054", # numeric-literal-too-long ] preview = true select = [ - "E", - "W", - "I", - "UP", - "ANN", - "COM", - "EXE", - "ICN", - "INP", - "PYI", - "Q", - "TID", - "TCH", - "ERA", - "PGH", - "RUF", - "PLC0105", - "PLC0131", - "PLC0132", - "PLC0414", - "PLE0303", - "PLE0304", - "PLE0305", - "PLE0307", - "PLE0308", - "PLE0309", - "PLE0604", - "PLE0605", - "PLE1132", + "E", + "W", + "I", + "UP", + "ANN", + "COM", + "EXE", + "ICN", + "INP", + "PYI", + "Q", + "TID", + "TCH", + "ERA", + "PGH", + "RUF", + "PLC0105", + "PLC0131", + "PLC0132", + "PLC0414", + "PLE0303", + "PLE0304", + "PLE0305", + "PLE0307", + "PLE0308", + "PLE0309", + "PLE0604", + "PLE0605", + "PLE1132", ] [tool.ruff.lint.flake8-import-conventions] banned-from = [ - "numpy", - "numpy.dtypes", - "numpy.exceptions", - "numpy.emath", - "numpy.fft", - "numpy.linalg", - "numpy.ma", - "numpy.polynomial", - "numpy.random", - "numpy.rec", - "numpy.typing", - "numpy.strings", - "optype", - "optype.numpy", - "optype.typing", + "numpy", + "numpy.dtypes", + "numpy.exceptions", + "numpy.emath", + "numpy.fft", + "numpy.linalg", + "numpy.ma", + "numpy.polynomial", + "numpy.random", + "numpy.rec", + "numpy.typing", + "numpy.strings", + "optype", + "optype.numpy", + "optype.typing", ] [tool.ruff.lint.flake8-import-conventions.extend-aliases] "numpy" = "np" @@ -201,11 +197,11 @@ combine-as-imports = true known-first-party = ["scipy"] no-lines-before = ["typing", "first-party", "local-folder"] section-order = [ - "standard-library", - "typing", - "third-party", - "first-party", - "local-folder", + "standard-library", + "typing", + "third-party", + "first-party", + "local-folder", ] split-on-trailing-comma = true