Skip to content
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
29 changes: 26 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,37 @@ repos:
- id: mixed-line-ending
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows

# - repo: https://github.com/PyCQA/docformatter
# rev: master
# hooks:
# - id: docformatter
# additional_dependencies: [tomli]
# args: [--in-place, --wrap-descriptions=120, --wrap-summaries=120]
# # --config, ./pyproject.toml

# - repo: https://github.com/psf/black
# rev: 24.8.0
# hooks:
# - id: black
# language_version: python3

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.15.6
rev: v0.16.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
# Run the linter.
- id: ruff-check
args: [--fix, --exit-zero]
# Run the formatter.
- id: ruff-format

## If like to embrace black styles even in the docs:
# - repo: https://github.com/asottile/blacken-docs
# rev: v1.13.0
# hooks:
# - id: blacken-docs
# additional_dependencies: [black]

## Check for misspells in documentation files:
# - repo: https://github.com/codespell-project/codespell
# rev: v2.2.5
Expand Down
12 changes: 7 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@ version_scheme = "no-guess-dev"
[tool.ruff]
line-length = 120
src = ["src"]
exclude = ["tests"]
lint.extend-ignore = ["F821"]
exclude = ["tests", "docs"]

[tool.ruff.lint]
extend-ignore = ["F821"]

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402", "F401"]

[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = 20

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402", "F401"]
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
if __name__ == "__main__":
try:
setup(use_scm_version={"version_scheme": "no-guess-dev"})
except: # noqa
except:
print(
"\n\nAn error occurred while building the project, "
"please ensure you have the most updated version of setuptools, "
Expand Down
15 changes: 8 additions & 7 deletions src/biocsetup/create_repository.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import shutil
from pathlib import Path
from typing import Optional

from pyscaffold import api, file_system, shell
from pyscaffoldext.markdown.extension import Markdown
Expand All @@ -12,7 +11,7 @@

def create_repository(
project_path: str,
description: Optional[str] = "Add a short description here!",
description: str | None = "Add a short description here!",
license: str = "MIT",
rst: bool = False,
) -> None:
Expand Down Expand Up @@ -154,18 +153,20 @@ def create_repository(
[tool.ruff]
line-length = 120
src = ["src"]
exclude = ["tests"]
lint.extend-ignore = ["F821"]
exclude = ["tests", "docs"]

[tool.ruff.lint]
extend-ignore = ["F821"]

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402", "F401"]

[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = 20

[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["E402", "F401"]
"""

with open(pyprj_path, "w") as f:
Expand Down
31 changes: 27 additions & 4 deletions src/biocsetup/templates/precommit/pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exclude: '^docs/conf.py'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
Expand All @@ -17,14 +17,37 @@ repos:
- id: mixed-line-ending
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows

# - repo: https://github.com/PyCQA/docformatter
# rev: master
# hooks:
# - id: docformatter
# additional_dependencies: [tomli]
# args: [--in-place, --wrap-descriptions=120, --wrap-summaries=120]
# # --config, ./pyproject.toml

# - repo: https://github.com/psf/black
# rev: 24.8.0
# hooks:
# - id: black
# language_version: python3

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.8.2
rev: v0.16.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
# Run the linter.
- id: ruff-check
args: [--fix, --exit-zero]
# Run the formatter.
- id: ruff-format

## If like to embrace black styles even in the docs:
# - repo: https://github.com/asottile/blacken-docs
# rev: v1.13.0
# hooks:
# - id: blacken-docs
# additional_dependencies: [black]

## Check for misspells in documentation files:
# - repo: https://github.com/codespell-project/codespell
# rev: v2.2.5
Expand Down
Loading