diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1938c8c --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.bumpversion.toml linguist-generated=true diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml deleted file mode 100644 index b4e9f00..0000000 --- a/.github/workflows/pull-request.yaml +++ /dev/null @@ -1,17 +0,0 @@ -name: pull-request -on: - pull_request: - branches: - - master - schedule: - - cron: 28 6 * * * -jobs: - pre-commit: - runs-on: ubuntu-latest - steps: - - if: github.event_name == 'pull_request' - name: Run 'pre-commit' hooks - uses: dycw/action-run-hooks@latest - with: - repos: |- - pre-commit/pre-commit-hooks diff --git a/.github/workflows/push.yaml b/.github/workflows/push.yaml index a098ca7..a965fce 100644 --- a/.github/workflows/push.yaml +++ b/.github/workflows/push.yaml @@ -1,5 +1,5 @@ name: push -on: +"on": push: branches: - master diff --git a/.gitignore b/.gitignore index 3bad797..4a65bcb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,223 +1,4 @@ -#### STANDARD GITIGNORE ####################################################### - -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[codz] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -share/python-wheels/ -*.egg-info/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage.xml -*.cover -*.py.cover -.hypothesis/ -.pytest_cache/ -cover/ - -# Translations -*.mo -*.pot - -# Django stuff: -*.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -.pybuilder/ -target/ - -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -# Pipfile.lock - -# UV -# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# uv.lock - -# poetry -# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. -# This is especially recommended for binary packages to ensure reproducibility, and is more -# commonly ignored for libraries. -# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control -# poetry.lock -# poetry.toml - -# pdm -# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. -# pdm recommends including project-wide configuration in pdm.toml, but excluding .pdm-python. -# https://pdm-project.org/en/latest/usage/project/#working-with-version-control -# pdm.lock -# pdm.toml -.pdm-python -.pdm-build/ - -# pixi -# Similar to Pipfile.lock, it is generally recommended to include pixi.lock in version control. -# pixi.lock -# Pixi creates a virtual environment in the .pixi directory, just like venv module creates one -# in the .venv directory. It is recommended not to include this directory in version control. -.pixi - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# Redis -*.rdb -*.aof -*.pid - -# RabbitMQ -mnesia/ -rabbitmq/ -rabbitmq-data/ - -# ActiveMQ -activemq-data/ - -# SageMath parsed files -*.sage.py - -# Environments -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ - -# Cython debug symbols -cython_debug/ - -# PyCharm -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. -# .idea/ - -# Abstra -# Abstra is an AI-powered process automation framework. -# Ignore directories containing user credentials, local state, and settings. -# Learn more at https://abstra.io/docs -.abstra/ - -# Visual Studio Code -# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore -# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore -# and can be added to the global gitignore or merged into this file. However, if you prefer, -# you could uncomment the following to ignore the entire vscode folder -# .vscode/ - -# Ruff stuff: -.ruff_cache/ - -# PyPI configuration file -.pypirc - -# Marimo -marimo/_static/ -marimo/_lsp/ -__marimo__/ - -# Streamlit -.streamlit/secrets.toml - -#### END OF STANDARD GITIGNORE ################################################ - -#### CUSTOM GITIGNORE ######################################################### +#### GENERIC GITIGNORE ######################################################### **/*.csv **/*.db @@ -241,4 +22,4 @@ pickles/ shelves/ tmp/ -#### END OF CUSTOM GITIGNORE ################################################## +#### END OF GENERIC GITIGNORE ################################################# diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 571a67e..025eb2b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,43 +1,76 @@ repos: - - repo: https://github.com/dycw/actions - rev: 0.10.3 + - repo: https://github.com/dycw/pre-commit-hooks + rev: 0.14.118 hooks: - - id: conformalize-repo + - id: add-hooks args: - - --ci--pull-request--pre-commit - - --ci--push--tag + - --ci-github - --description=Template for generic repositories - - --gitignore - - --pre-commit--prettier - - --pre-commit--taplo - - --readme + - --prettier - --repo-name=template-generic - - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v6.0.0 + - --toml + priority: 10 + - id: check-versions-consistent + priority: 40 + - id: format-pre-commit-config + priority: 30 + - id: run-prek-autoupdate + priority: 10 + - id: run-version-bump + priority: 20 + - id: setup-bump-my-version + priority: 20 + - id: setup-ci-push + priority: 20 + - id: setup-git + priority: 20 + - id: setup-pre-commit + priority: 10 + - id: setup-readme + args: + - --repo-name=template-generic + - --description=Template for generic repositories + priority: 20 + - id: update-ci-action-versions + priority: 20 + - id: update-ci-extensions + priority: 20 + - repo: builtin hooks: + - id: check-added-large-files + priority: 40 + - id: check-case-conflict + priority: 40 - id: check-executables-have-shebangs + priority: 40 + - id: check-json + priority: 40 + - id: check-json5 + priority: 40 - id: check-merge-conflict + priority: 40 - id: check-symlinks - - id: destroyed-symlinks + priority: 40 + - id: check-toml + priority: 40 + - id: check-xml + priority: 40 + - id: check-yaml + priority: 40 - id: detect-private-key + priority: 40 - id: end-of-file-fixer + priority: 20 + - id: fix-byte-order-marker + priority: 20 - id: mixed-line-ending args: - --fix=lf + priority: 20 - id: no-commit-to-branch - - id: pretty-format-json - args: - - --autofix + priority: 40 - id: trailing-whitespace - - repo: local - hooks: - - id: prettier - name: prettier - entry: npx prettier --write - language: system - types_or: - - markdown - - yaml + priority: 20 - repo: https://github.com/compwa/taplo-pre-commit rev: v0.9.3 hooks: @@ -49,3 +82,25 @@ repos: - indent_entries=true - --option - reorder_keys=true + priority: 40 + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: check-illegal-windows-names + priority: 40 + - id: destroyed-symlinks + priority: 40 + - id: pretty-format-json + args: + - --autofix + priority: 20 + - repo: local + hooks: + - id: prettier + name: prettier + entry: npx prettier --write + language: unsupported + types_or: + - markdown + - yaml + priority: 30