update pyproject.toml for ruff format
(#48823)
Add ruff configuration to `pyproject.toml`. This allows `ruff format` in the Spack repository to format all the files we care about, with our line length of 99, the exceptions we already put in place, and excluding things we don't auto-format, like vendored dependencies. Right now it'll reformat 175 or so files, but only slightly, in places where `ruff` differs from `black`. For the most part I like the ruff format decisions better than `black`, but none of the changes seem too severe. This does not change `spack style` -- I figure that can come later but this at least will let people start playing with `ruff`. --------- Signed-off-by: Todd Gamblin <tgamblin@llnl.gov>
This commit is contained in:
parent
41e0863b86
commit
71d1901831
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
# flake8: noqa: F401
|
# flake8: noqa: F401, E402
|
||||||
"""spack.package defines the public API for Spack packages, by re-exporting useful symbols from
|
"""spack.package defines the public API for Spack packages, by re-exporting useful symbols from
|
||||||
other modules. Packages should import this module, instead of importing from spack.* directly
|
other modules. Packages should import this module, instead of importing from spack.* directly
|
||||||
to ensure forward compatibility with future versions of Spack."""
|
to ensure forward compatibility with future versions of Spack."""
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
[project]
|
[project]
|
||||||
name="spack"
|
name="spack"
|
||||||
description="The spack package manager"
|
description="The spack package manager"
|
||||||
|
requires-python=">=3.6"
|
||||||
dependencies=[
|
dependencies=[
|
||||||
"clingo",
|
"clingo",
|
||||||
"setuptools",
|
"setuptools",
|
||||||
@ -67,9 +68,42 @@ features = [
|
|||||||
"ci",
|
"ci",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[tool.ruff]
|
||||||
|
line-length = 99
|
||||||
|
extend-include = ["bin/spack"]
|
||||||
|
extend-exclude = ["lib/spack/external", "*.pyi"]
|
||||||
|
|
||||||
|
[tool.ruff.format]
|
||||||
|
skip-magic-trailing-comma = true
|
||||||
|
|
||||||
|
[tool.ruff.lint]
|
||||||
|
extend-select = ["I"]
|
||||||
|
ignore = ["E731", "E203"]
|
||||||
|
|
||||||
|
[tool.ruff.lint.isort]
|
||||||
|
split-on-trailing-comma = false
|
||||||
|
section-order = [
|
||||||
|
"future",
|
||||||
|
"standard-library",
|
||||||
|
"third-party",
|
||||||
|
"archspec",
|
||||||
|
"llnl",
|
||||||
|
"spack",
|
||||||
|
"first-party",
|
||||||
|
"local-folder",
|
||||||
|
]
|
||||||
|
|
||||||
|
[tool.ruff.lint.isort.sections]
|
||||||
|
spack = ["spack"]
|
||||||
|
archspec = ["archspec"]
|
||||||
|
llnl = ["llnl"]
|
||||||
|
|
||||||
|
[tool.ruff.lint.per-file-ignores]
|
||||||
|
"var/spack/repos/*/package.py" = ["F403", "F405", "F811", "F821"]
|
||||||
|
"*-ci-package.py" = ["F403", "F405", "F821"]
|
||||||
|
|
||||||
[tool.black]
|
[tool.black]
|
||||||
line-length = 99
|
line-length = 99
|
||||||
target-version = ['py36', 'py37', 'py38', 'py39', 'py310']
|
|
||||||
include = '(lib/spack|var/spack/repos)/.*\.pyi?$|bin/spack$'
|
include = '(lib/spack|var/spack/repos)/.*\.pyi?$|bin/spack$'
|
||||||
extend-exclude = 'lib/spack/external'
|
extend-exclude = 'lib/spack/external'
|
||||||
skip_magic_trailing_comma = true
|
skip_magic_trailing_comma = true
|
||||||
|
Loading…
Reference in New Issue
Block a user