Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use 4-space indentation for toml #56

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
142 changes: 69 additions & 73 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,18 @@
build-backend = "poetry.core.masonry.api"
requires = ["poetry-core"]


[tool.poetry]
authors = ["Joren Hammudoglu <jhammudoglu@gmail.com>"]
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"
Expand Down Expand Up @@ -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"
Expand All @@ -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
Expand All @@ -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"]
Expand All @@ -115,7 +112,6 @@ reportPrivateUsage = false
reportUnnecessaryTypeIgnoreComment = true
reportUnsafeMultipleInheritance = true


[tool.ruff]
builtins = ["reveal_locals", "reveal_type"]
exclude = ["scipy-pyright", ".venv"]
Expand All @@ -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"
Expand All @@ -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

Expand Down
Loading