Skip to content

Commit

Permalink
feat: Sync latest project configuration
Browse files Browse the repository at this point in the history
- Use Ruff for linting and formatting
- Default documentation directory is 'doc'
  • Loading branch information
attakei committed Mar 23, 2024
1 parent f7f658c commit e44099f
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 34 deletions.
28 changes: 9 additions & 19 deletions {{cookiecutter.project_basename}}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
repos:
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.3.0
hooks:
# Run the linter.
- id: ruff
# Run the formatter.
- id: ruff-format
- repo: https://github.com/PyCQA/doc8
rev: v1.0.0
hooks:
- id: doc8
args:
- '--max-line-length=119'
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
- id: flake8
args:
- '--max-line-length=88'
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.1.1
hooks:
- id: pydocstyle
- --max-line-length=119
4 changes: 4 additions & 0 deletions {{cookiecutter.project_basename}}/doc/.ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extend = "../pyproject.toml"

[lint]
ignore = ["D100", "D103"]
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# noqa: D100
from {{ cookiecutter.package_fullname }} import __version__ as version

# -- Project information
Expand Down
8 changes: 7 additions & 1 deletion {{cookiecutter.project_basename}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,13 @@ dev-dependencies = [
setup = {chain = ["setup:sync", "setup:pre-commit"]}
"setup:sync" = "rye sync --no-lock --all-features"
"setup:pre-commit" = "pre-commit install"
doc = "make -C docs"
doc = "make -C doc"

[tool.ruff.lint]
select = ["C90", "D", "E", "F", "I", "W"]

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

[tool.hatch.metadata]
allow-direct-references = true
Expand Down
12 changes: 0 additions & 12 deletions {{cookiecutter.project_basename}}/setup.cfg

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""{{ cookiecutter.description }}"""
"""{{ cookiecutter.description }}."""

from sphinx.application import Sphinx

__version__ = "{{ cookiecutter.version }}"
Expand Down
4 changes: 4 additions & 0 deletions {{cookiecutter.project_basename}}/tests/.ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extend = "../pyproject.toml"

[lint]
ignore = ["D100", "D103"]
1 change: 1 addition & 0 deletions {{cookiecutter.project_basename}}/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Configuration for pytest."""

import pytest
from sphinx.testing.path import path

Expand Down
2 changes: 2 additions & 0 deletions {{cookiecutter.project_basename}}/tests/test_it.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Standard tests."""

from io import StringIO

import pytest
Expand All @@ -8,3 +9,4 @@
@pytest.mark.sphinx("html")
def test__it(app: SphinxTestApp, status: StringIO, warning: StringIO):
"""Test to pass."""
app.build()

0 comments on commit e44099f

Please sign in to comment.