Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init pre-commit #107

Merged
merged 3 commits into from
Oct 17, 2024
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
36 changes: 36 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# .pre-commit-config.yaml

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: ^unit_tests/

- repo: https://github.com/psf/black
rev: 23.9.1 # Use the latest stable version
hooks:
- id: black
args: [--line-length=80]

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0 # Use the latest stable version
hooks:
- id: flake8
args: [--max-line-length=80]
additional_dependencies: [flake8-docstrings]

- repo: https://github.com/PyCQA/pydocstyle
rev: 6.3.0
hooks:
- id: pydocstyle
args: [--convention=google]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
hooks:
- id: mypy
args: [--strict]
4 changes: 2 additions & 2 deletions docs/source/citation.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Citation
==================================
If you use this project in your research, please cite it as :cite:`YourReferenceHere`
If you use this project in your research, please cite it as:

.. bibliography:: references.bib
:style: unsrt
Expand All @@ -9,4 +9,4 @@ If you use this project in your research, please cite it as :cite:`YourReference
Alternatively, you can cite the project using the following BibTeX entry:

.. literalinclude:: references.bib
:language: bibtex
:language: bibtex
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ matplotlib = ">=3.3.3"

[tool.poetry.dev-dependencies]
pytest = "^6.2.2"
pre-commit = "^4.0.0"

[tool.poetry.group.docs.dependencies]
sphinx = "^6.2.1"
sphinx-rtd-theme = "^1.0.0" # If you're using the Read the Docs theme
sphinx-autoapi = ">=3.0.0"
Expand Down
4 changes: 2 additions & 2 deletions readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build:
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
# VIRTUAL_ENV needs to be set manually for now.
# See https://github.com/readthedocs/readthedocs.org/pull/11152/
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with dev
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with docs
# Generate references.bib using the Python script
- python scripts/generate_references.py

Expand All @@ -24,4 +24,4 @@ build:


sphinx:
configuration: docs/source/conf.py
configuration: docs/source/conf.py
Loading