diff --git a/template/.pre-commit-config.yaml b/template/.pre-commit-config.yaml index 4fb45e3..4bcc4aa 100644 --- a/template/.pre-commit-config.yaml +++ b/template/.pre-commit-config.yaml @@ -12,11 +12,12 @@ repos: rev: 1.7.5 hooks: - id: bandit -- repo: https://github.com/pycqa/pydocstyle - rev: 6.3.0 +- repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.1.6 hooks: - - id: pydocstyle - name: Enforce docstrings + - id: ruff + args: [ --fix ] + - id: ruff-format - repo: https://github.com/pycqa/docformatter rev: v1.7.5 hooks: diff --git a/template/docs/source/conf.py.jinja b/template/docs/source/conf.py.jinja index 940e7cf..593838a 100644 --- a/template/docs/source/conf.py.jinja +++ b/template/docs/source/conf.py.jinja @@ -2,30 +2,30 @@ # -- Project information -project = '{{package_name}}' +project = "{{package_name}}" # -- General configuration extensions = [ - 'sphinx.ext.duration', - 'sphinx.ext.doctest', - 'sphinx.ext.autodoc', - 'sphinx.ext.autosummary', - 'sphinx.ext.intersphinx', - 'sphinx_immaterial', + "sphinx.ext.duration", + "sphinx.ext.doctest", + "sphinx.ext.autodoc", + "sphinx.ext.autosummary", + "sphinx.ext.intersphinx", + "sphinx_immaterial", ] intersphinx_mapping = { - 'python': ('https://docs.python.org/3/', None), - 'sphinx': ('https://www.sphinx-doc.org/en/master/', None), + "python": ("https://docs.python.org/3/", None), + "sphinx": ("https://www.sphinx-doc.org/en/master/", None), } -intersphinx_disabled_domains = ['std'] +intersphinx_disabled_domains = ["std"] -templates_path = ['_templates'] +templates_path = ["_templates"] # -- Options for HTML output -html_theme = 'sphinx_immaterial' +html_theme = "sphinx_immaterial" html_theme_options = { "repo_url": "https://github.com//", "edit_uri": "blob/main/docs/source", @@ -54,4 +54,4 @@ autodoc_default_options = { } # -- Options for EPUB output -epub_show_urls = 'footnote' +epub_show_urls = "footnote" diff --git a/template/src/{{package_name}}/cli.py b/template/src/{{package_name}}/cli.py index 541b4d5..80729bf 100644 --- a/template/src/{{package_name}}/cli.py +++ b/template/src/{{package_name}}/cli.py @@ -8,7 +8,7 @@ def parse_args(args=None): """Parse arguments.""" parser = argparse.ArgumentParser() parser.add_argument( - 'number', + "number", type=float, ) return parser.parse_args(args=args) diff --git a/template/tests/test_cli.py.jinja b/template/tests/test_cli.py.jinja index fd4ddf1..0c700d6 100644 --- a/template/tests/test_cli.py.jinja +++ b/template/tests/test_cli.py.jinja @@ -4,7 +4,6 @@ from {{package_name}}.cli import main class TestCLI(unittest.TestCase): - def test_cli(self): args = str(5) self.assertEqual(main(args=args), 6) diff --git a/template/tests/test_main.py.jinja b/template/tests/test_main.py.jinja index 4672adf..bb5cf2f 100644 --- a/template/tests/test_main.py.jinja +++ b/template/tests/test_main.py.jinja @@ -4,6 +4,5 @@ from {{package_name}}.main import add_one class TestMain(unittest.TestCase): - def test_add_one(self): self.assertEqual(add_one(5), 6)