2023-05-19 20:35:05 +03:00
|
|
|
# See https://pre-commit.com for more information
|
|
|
|
# See https://pre-commit.ci for more information
|
2023-04-12 08:58:19 +03:00
|
|
|
ci:
|
2023-05-18 10:17:01 +03:00
|
|
|
# Attempts to use networking and fails at name resolution, local hook
|
2023-06-04 11:41:12 +03:00
|
|
|
# skip: [bundler-audit, pylint, latexmk, exiftool]
|
2023-05-09 10:57:01 +03:00
|
|
|
# Forĝejo/Gitea mirrors will autoclose pull requests. This should decrease
|
|
|
|
# the frequency of unnecessary PRs.
|
|
|
|
# https://github.com/pre-commit-ci/issues/issues/83
|
2023-05-09 10:58:31 +03:00
|
|
|
autoupdate_schedule: quarterly
|
2023-04-12 08:58:19 +03:00
|
|
|
|
2023-09-24 11:39:37 +03:00
|
|
|
# Override hook language versions from system defaults
|
|
|
|
default_language_version:
|
2023-09-28 14:36:27 +03:00
|
|
|
python: pypy3
|
2023-09-24 11:39:37 +03:00
|
|
|
|
2023-02-21 16:16:09 +02:00
|
|
|
repos:
|
2023-02-21 17:52:47 +02:00
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2023-10-09 11:06:55 +03:00
|
|
|
rev: v4.5.0
|
2023-02-21 16:16:09 +02:00
|
|
|
hooks:
|
2023-02-24 15:03:23 +02:00
|
|
|
- id: check-added-large-files
|
2023-02-21 17:52:47 +02:00
|
|
|
- id: check-case-conflict
|
2023-05-12 10:02:20 +03:00
|
|
|
- id: check-yaml
|
2023-02-21 17:52:47 +02:00
|
|
|
- id: check-executables-have-shebangs
|
|
|
|
- id: check-shebang-scripts-are-executable
|
|
|
|
- id: destroyed-symlinks
|
|
|
|
- id: detect-private-key
|
2023-02-21 20:09:54 +02:00
|
|
|
- id: end-of-file-fixer
|
2023-05-18 11:33:33 +03:00
|
|
|
exclude: .*\.nginx$
|
2023-02-21 17:52:47 +02:00
|
|
|
- id: fix-byte-order-marker
|
2023-05-07 18:15:16 +03:00
|
|
|
- id: trailing-whitespace
|
|
|
|
# Let's not touch LICENSE files or reuse.software directory
|
|
|
|
exclude: ^LICENSES\/.*|LICENSE$
|
|
|
|
# File types depending on trailing whitespace. Use identify-cli
|
2023-09-17 20:28:44 +03:00
|
|
|
exclude_types: [svg, markdown, tsv]
|
2023-04-05 09:48:06 +03:00
|
|
|
|
2023-09-24 12:03:08 +03:00
|
|
|
- repo: https://github.com/pre-commit-ci/pre-commit-ci-config
|
|
|
|
rev: v1.6.1
|
|
|
|
hooks:
|
|
|
|
- id: check-pre-commit-ci-config
|
|
|
|
|
2023-04-05 09:48:06 +03:00
|
|
|
# Markdown Table of Contents generation.
|
|
|
|
- repo: https://github.com/thlorenz/doctoc
|
|
|
|
rev: v2.2.0
|
|
|
|
hooks:
|
|
|
|
- id: doctoc
|
|
|
|
# https://github.com/Mikaela/gist/blob/master/doctoc.txt
|
2023-05-13 09:04:46 +03:00
|
|
|
args: [--update-only, --notitle]
|
2023-04-05 09:48:06 +03:00
|
|
|
|
2023-05-18 10:17:01 +03:00
|
|
|
# Python type checking
|
2023-05-18 10:20:21 +03:00
|
|
|
# - repo: https://github.com/pre-commit/mirrors-mypy
|
|
|
|
# rev: "v1.3.0"
|
|
|
|
# hooks:
|
|
|
|
# - id: mypy
|
2023-05-18 10:17:01 +03:00
|
|
|
|
2023-04-05 09:48:06 +03:00
|
|
|
# GitHub Actions etc. configuration validity checking
|
2023-05-22 16:54:10 +03:00
|
|
|
- repo: https://github.com/python-jsonschema/check-jsonschema
|
2023-10-01 19:03:41 +03:00
|
|
|
rev: 0.27.0
|
2023-05-22 16:54:10 +03:00
|
|
|
hooks:
|
|
|
|
#- id: check-dependabot
|
|
|
|
#- id: check-github-actions
|
|
|
|
#- id: check-github-workflows
|
|
|
|
- id: check-gitlab-ci
|
2023-04-05 09:48:06 +03:00
|
|
|
|
2023-05-18 10:20:21 +03:00
|
|
|
# - repo: https://github.com/jumanjihouse/pre-commit-hooks
|
|
|
|
# rev: 3.0.0
|
|
|
|
# hooks:
|
|
|
|
# - id: bundler-audit
|
|
|
|
# https://github.com/jumanjihouse/pre-commit-hooks/issues/111
|
|
|
|
#- id: check-mailmap
|
2023-04-09 13:58:35 +03:00
|
|
|
|
2023-04-05 09:48:06 +03:00
|
|
|
# Easierish licensing when attempting reuse compliancy
|
2023-05-21 13:09:30 +03:00
|
|
|
- repo: https://github.com/fsfe/reuse-tool
|
2023-07-29 21:31:33 +03:00
|
|
|
rev: v2.1.0
|
2023-05-21 13:09:30 +03:00
|
|
|
hooks:
|
|
|
|
- id: reuse
|
2023-04-05 09:48:06 +03:00
|
|
|
|
|
|
|
# prettier & editorconfig checker should probably be ran last
|
|
|
|
|
2023-05-18 10:20:21 +03:00
|
|
|
# prettier, opinionated code formatter
|
2023-02-21 17:52:47 +02:00
|
|
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
2023-09-17 20:30:23 +03:00
|
|
|
rev: "v3.0.3"
|
2023-02-21 17:52:47 +02:00
|
|
|
hooks:
|
|
|
|
- id: prettier
|
2023-08-20 11:11:45 +03:00
|
|
|
exclude_types:
|
|
|
|
[python, pyi, jupyter]
|
|
|
|
#additional_dependencies:
|
|
|
|
#[
|
2023-08-24 16:01:37 +03:00
|
|
|
# https://www.npmjs.com/package/prettier
|
2023-08-20 11:11:45 +03:00
|
|
|
#"prettier@3.0.1",
|
2023-08-24 16:01:37 +03:00
|
|
|
# https://www.npmjs.com/package/prettier-plugin-nginx
|
2023-08-20 11:11:45 +03:00
|
|
|
#"prettier-plugin-nginx@1.0.3",
|
2023-08-24 16:01:37 +03:00
|
|
|
# https://www.npmjs.com/package/prettier-plugin-toml
|
2023-08-20 11:11:45 +03:00
|
|
|
#"prettier-plugin-toml@1.0.0",
|
|
|
|
#]
|
2023-05-18 10:20:21 +03:00
|
|
|
|
|
|
|
# Black, opinionated Python code formatter
|
|
|
|
# - repo: https://github.com/psf/black
|
|
|
|
# rev: 23.3.0
|
|
|
|
# hooks:
|
|
|
|
# - id: black
|
|
|
|
#- id: black-jupyter
|
2023-04-05 09:48:06 +03:00
|
|
|
|
2023-05-18 11:58:51 +03:00
|
|
|
# Shell code formatter, requires Go
|
|
|
|
- repo: https://github.com/scop/pre-commit-shfmt
|
2023-06-25 14:18:37 +03:00
|
|
|
rev: v3.7.0-1
|
2023-05-18 11:58:51 +03:00
|
|
|
hooks:
|
|
|
|
- id: shfmt
|
|
|
|
#- id: shfmt-docker
|
|
|
|
|
2023-04-05 09:48:06 +03:00
|
|
|
# .editorconfig validity checking
|
2023-02-21 19:28:28 +02:00
|
|
|
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
|
2023-06-25 14:18:37 +03:00
|
|
|
rev: "2.7.2"
|
2023-02-21 18:23:28 +02:00
|
|
|
hooks:
|
2023-02-21 19:28:28 +02:00
|
|
|
- id: editorconfig-checker
|
2023-02-21 18:23:28 +02:00
|
|
|
alias: ec
|
2023-04-04 09:47:06 +03:00
|
|
|
# I don't actually care about line lengths as more than a guideline
|
|
|
|
args: [-disable-max-line-length]
|
2023-05-18 11:33:33 +03:00
|
|
|
exclude: .*\.nginx$
|
2023-05-18 10:17:01 +03:00
|
|
|
|
2023-05-18 10:20:21 +03:00
|
|
|
# # Python linter
|
|
|
|
# - repo: local
|
|
|
|
# hooks:
|
|
|
|
# - id: pylint
|
|
|
|
# name: pylint
|
|
|
|
# entry: pylint
|
|
|
|
# language: system
|
|
|
|
# types_or: [python, pyi]
|
2023-05-20 13:15:16 +03:00
|
|
|
|
|
|
|
# # Checking that LaTeX compiles
|
|
|
|
# - repo: local
|
|
|
|
# hooks:
|
|
|
|
# - id: latexmk
|
|
|
|
# name: latexmk
|
|
|
|
# entry: latexmk -quiet
|
|
|
|
# language: system
|
|
|
|
# types: [text, tex]
|
2023-06-04 11:41:12 +03:00
|
|
|
|
|
|
|
# Fedora: perl-Image-ExifTool
|
|
|
|
# - repo: local
|
|
|
|
# hooks:
|
|
|
|
# - id: exiftool
|
|
|
|
# name: Remove all EXIF metadata using exiftool
|
|
|
|
# entry: exiftool -all=
|
|
|
|
# language: system
|
|
|
|
# types: [image]
|