Skip to content

Commit

Permalink
feat: Add more pre commits hooks (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
YurelyCamacho authored Dec 30, 2024
1 parent 122be2e commit 72f0bf2
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 9 deletions.
16 changes: 15 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,23 @@ default_stages:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.6.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-json
exclude: "src/scicookie/{{cookiecutter.project_slug}}.*"
- id: check-toml
exclude: "src/scicookie/{{cookiecutter.project_slug}}.*"
- id: check-xml
- id: debug-statements
exclude: "src/scicookie/{{cookiecutter.project_slug}}.*|src/scicookie/hooks/.*"
- id: check-builtin-literals
exclude: "src/scicookie/{{cookiecutter.project_slug}}.*|src/scicookie/hooks/.*"
- id: check-case-conflict
- id: check-docstring-first
exclude: "src/scicookie/{{cookiecutter.project_slug}}.*"
- id: detect-private-key

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.2"
Expand Down
4 changes: 2 additions & 2 deletions src/scicookie/hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def move_selected_doc_dir():
if DOCUMENTATION_ENGINE.startswith("sphinx"):
DOCS_SPHINX = Path(DOCS_SPEC_DIR).parent
remove_project_file(Path("docs") / "index.md")

for file_name in ['conf.py', 'make.bat', 'readme.md']:
try:
shutil.move(DOCS_SPHINX / file_name, docs_target_dir)
Expand Down Expand Up @@ -167,7 +167,7 @@ def clean_up_automation():
def clean_up_docs():
move_selected_doc_dir()
remove_dirs(ALL_DOCS_DIRS)


def clean_up_project_layout():
if USE_SRC_LAYOUT:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,18 @@ default_stages:
- pre-commit
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.6.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-json
- id: check-toml
- id: check-xml
- id: debug-statements
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: detect-private-key
{# keep this comment #}
{%- if cookiecutter.use_prettier == "yes" %}
- repo: https://github.com/pre-commit/mirrors-prettier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ dev = [
{%- elif cookiecutter.documentation_engine == 'quarto' %}
"quarto-cli >= 1.5.56",
"quartodoc >= 0.7.5",
{%- endif %}
{%- endif -%}
# 'PosixPath' object has no attribute 'endswith'
"virtualenv<=20.25.1",
]
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ markdown_extensions:
- docs/static/icons
- pymdownx.details
- pymdownx.highlight:
pygments_lang_class: true
pygments_lang_class: true
- pymdownx.inlinehilite:
style_plain_text: python
- pymdownx.magiclink:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
```{admonition} API documentation with sphinx-autodoc2
:class: important
You can also build the API documentation using [sphinx-autodoc2 extension](https://sphinx-autodoc2.readthedocs.io/en/latest/).
You can also build the API documentation using [sphinx-autodoc2 extension](https://sphinx-autodoc2.readthedocs.io/en/latest/).
```
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Welcome to {{ cookiecutter.project_name }}'s documentation!
Example <example>
contributing
changelog


Indices and tables
==================
Expand Down
2 changes: 1 addition & 1 deletion tests/smoke/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export PATH=$(echo $PATH| sed -E "s/[^:]+\/scicookie\/[^:]+//g")

BUILD_SYSTEM="others"

COMMAND_PREFIX=
COMMAND_PREFIX=
if command -v poetry &> /dev/null; then
poetry install
elif command -v flit &> /dev/null; then
Expand Down

0 comments on commit 72f0bf2

Please sign in to comment.