Skip to content

Commit

Permalink
use fixed version of formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep committed Jul 31, 2024
1 parent 12691c3 commit 8ef588f
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 62 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repos:
additional_dependencies: ["@biomejs/[email protected]"]
# Hooks that are run for scripts
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "2.1.4"
rev: "2.2.1"
hooks:
- id: pyproject-fmt
files: ^scripts/
Expand Down
24 changes: 8 additions & 16 deletions scripts/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[build-system]
build-backend = "hatchling.build"
requires = [
"hatch-vcs",
"hatchling",
]
requires = [ "hatch-vcs", "hatchling" ]

[project]
name = "scverse-template-scripts"
Expand All @@ -19,9 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dynamic = [
"version",
]
dynamic = [ "version" ]
dependencies = [
"cruft",
"furl",
Expand Down Expand Up @@ -102,17 +97,14 @@ lint.per-file-ignores."tests/*.py" = [
lint.unfixable = [
"RUF001", # never “fix” “confusables”
]
lint.allowed-confusables = [
"×",
"",
]
lint.flake8-type-checking.exempt-modules = [
]
lint.allowed-confusables = [ "×", "" ]
lint.flake8-type-checking.exempt-modules = []
lint.flake8-type-checking.strict = true
lint.isort.known-first-party = [ "scverse_template_scripts", "testing.scverse_template_scripts" ]
lint.isort.required-imports = [
"from __future__ import annotations",
]
lint.isort.required-imports = [ "from __future__ import annotations" ]

[tool.pyproject-fmt]
column_width = 120

[tool.pytest.ini_options]
addopts = [
Expand Down
2 changes: 1 addition & 1 deletion {{cookiecutter.project_name}}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
- id: biome-format
additional_dependencies: ["@biomejs/[email protected]"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "2.1.4"
rev: "2.2.1"
hooks:
- id: pyproject-fmt
- repo: https://github.com/astral-sh/ruff-pre-commit
Expand Down
64 changes: 20 additions & 44 deletions {{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
[build-system]
build-backend = "hatchling.build"
requires = [
"hatchling",
]
requires = [ "hatchling" ]

[project]
name = "{{ cookiecutter.project_name }}"
Expand Down Expand Up @@ -63,12 +61,8 @@ packages = [ "src/{{ cookiecutter.package_name }}" ]

[tool.ruff]
line-length = 120
src = [
"src",
]
extend-include = [
"*.ipynb",
]
src = [ "src" ]
extend-include = [ "*.ipynb" ]

format.docstring-code-format = true

Expand All @@ -86,41 +80,23 @@ lint.select = [
"W", # Warning detected by Pycodestyle
]
lint.ignore = [
# Errors from function calls in argument defaults. These are fine when the result is immutable.
"B008",
# Missing docstring in public module
"D100",
# Missing docstring in public package
"D104",
# __magic__ methods are often self-explanatory, allow missing docstrings
"D105",
# Missing docstring in __init__
"D107",
# <>: Disable one in each pair of mutually incompatible rules
# <> We don’t want a blank line before a class docstring
"D203",
# <> We want docstrings to start immediately after the opening triple quote
"D213",
# first line should end with a period [Bug: doesn’t work with single-line docstrings]
"D400",
# First line should be in imperative mood; try rephrasing
"D401",
# line too long -> we accept long comment lines; formatter gets rid of long code lines
"E501",
# Do not assign a lambda expression, use a def -> lambda expression assignments are convenient
"E731",
# allow I, O, l as variable names -> I is the identity matrix
"E741",
]
lint.per-file-ignores."*/__init__.py" = [
"F401",
]
lint.per-file-ignores."docs/*" = [
"I",
]
lint.per-file-ignores."tests/*" = [
"D",
]
"B008", # Errors from function calls in argument defaults. These are fine when the result is immutable.
"D100", # Missing docstring in public module
"D104", # Missing docstring in public package
"D105", # __magic__ methods are often self-explanatory, allow missing docstrings
"D107", # Missing docstring in __init__
# Disable one in each pair of mutually incompatible rules
"D203", # We don’t want a blank line before a class docstring
"D213", # <> We want docstrings to start immediately after the opening triple quote
"D400", # first line should end with a period [Bug: doesn’t work with single-line docstrings]
"D401", # First line should be in imperative mood; try rephrasing
"E501", # line too long -> we accept long comment lines; formatter gets rid of long code lines
"E731", # Do not assign a lambda expression, use a def -> lambda expression assignments are convenient
"E741", # allow I, O, l as variable names -> I is the identity matrix
]
lint.per-file-ignores."*/__init__.py" = [ "F401" ]
lint.per-file-ignores."docs/*" = [ "I" ]
lint.per-file-ignores."tests/*" = [ "D" ]
lint.pydocstyle.convention = "numpy"

[tool.pytest.ini_options]
Expand Down

0 comments on commit 8ef588f

Please sign in to comment.