2023-05-19 19:35:05 +02:00
|
|
|
# See https://pre-commit.com for more information
|
|
|
|
# See https://pre-commit.ci for more information
|
2023-04-12 07:58:19 +02:00
|
|
|
ci:
|
2023-05-18 09:17:01 +02:00
|
|
|
# Attempts to use networking and fails at name resolution, local hook
|
2023-06-04 10:41:12 +02:00
|
|
|
# skip: [bundler-audit, pylint, latexmk, exiftool]
|
2023-05-09 09:57:01 +02: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 09:58:31 +02:00
|
|
|
autoupdate_schedule: quarterly
|
2023-04-12 07:58:19 +02:00
|
|
|
|
2023-02-21 15:16:09 +01:00
|
|
|
repos:
|
2023-02-21 16:52:47 +01:00
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2023-02-21 15:16:09 +01:00
|
|
|
rev: v4.4.0
|
|
|
|
hooks:
|
2023-02-24 14:03:23 +01:00
|
|
|
- id: check-added-large-files
|
2023-02-21 16:52:47 +01:00
|
|
|
- id: check-case-conflict
|
2023-05-12 09:02:20 +02:00
|
|
|
- id: check-yaml
|
2023-02-21 16:52:47 +01:00
|
|
|
- id: check-executables-have-shebangs
|
|
|
|
- id: check-shebang-scripts-are-executable
|
|
|
|
- id: destroyed-symlinks
|
|
|
|
- id: detect-private-key
|
2023-02-21 19:09:54 +01:00
|
|
|
- id: end-of-file-fixer
|
2023-05-18 10:33:33 +02:00
|
|
|
exclude: .*\.nginx$
|
2023-02-21 16:52:47 +01:00
|
|
|
- id: fix-byte-order-marker
|
2023-05-07 17:15:16 +02: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 19:28:44 +02:00
|
|
|
exclude_types: [svg, markdown, tsv]
|
2023-04-05 08:48:06 +02: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 08:04:46 +02:00
|
|
|
args: [--update-only, --notitle]
|
2023-04-05 08:48:06 +02:00
|
|
|
|
2023-05-18 09:17:01 +02:00
|
|
|
# Python type checking
|
2023-05-18 09:20:21 +02:00
|
|
|
# - repo: https://github.com/pre-commit/mirrors-mypy
|
|
|
|
# rev: "v1.3.0"
|
|
|
|
# hooks:
|
|
|
|
# - id: mypy
|
2023-05-18 09:17:01 +02:00
|
|
|
|
2023-04-05 08:48:06 +02:00
|
|
|
# GitHub Actions etc. configuration validity checking
|
2023-05-22 15:54:10 +02:00
|
|
|
- repo: https://github.com/python-jsonschema/check-jsonschema
|
2023-08-20 10:11:45 +02:00
|
|
|
rev: 0.24.1
|
2023-05-22 15:54:10 +02:00
|
|
|
hooks:
|
|
|
|
#- id: check-dependabot
|
|
|
|
#- id: check-github-actions
|
|
|
|
#- id: check-github-workflows
|
|
|
|
- id: check-gitlab-ci
|
2023-04-05 08:48:06 +02:00
|
|
|
|
2023-05-18 09:20:21 +02: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 12:58:35 +02:00
|
|
|
|
2023-04-05 08:48:06 +02:00
|
|
|
# Easierish licensing when attempting reuse compliancy
|
2023-05-21 12:09:30 +02:00
|
|
|
- repo: https://github.com/fsfe/reuse-tool
|
2023-07-29 20:31:33 +02:00
|
|
|
rev: v2.1.0
|
2023-05-21 12:09:30 +02:00
|
|
|
hooks:
|
|
|
|
- id: reuse
|
2023-04-05 08:48:06 +02:00
|
|
|
|
|
|
|
# prettier & editorconfig checker should probably be ran last
|
|
|
|
|
2023-05-18 09:20:21 +02:00
|
|
|
# prettier, opinionated code formatter
|
2023-02-21 16:52:47 +01:00
|
|
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
2023-08-20 10:11:45 +02:00
|
|
|
rev: "v3.0.2"
|
2023-02-21 16:52:47 +01:00
|
|
|
hooks:
|
|
|
|
- id: prettier
|
2023-08-20 10:11:45 +02:00
|
|
|
exclude_types:
|
|
|
|
[python, pyi, jupyter]
|
|
|
|
#additional_dependencies:
|
|
|
|
#[
|
2023-08-24 15:01:37 +02:00
|
|
|
# https://www.npmjs.com/package/prettier
|
2023-08-20 10:11:45 +02:00
|
|
|
#"prettier@3.0.1",
|
2023-08-24 15:01:37 +02:00
|
|
|
# https://www.npmjs.com/package/prettier-plugin-nginx
|
2023-08-20 10:11:45 +02:00
|
|
|
#"prettier-plugin-nginx@1.0.3",
|
2023-08-24 15:01:37 +02:00
|
|
|
# https://www.npmjs.com/package/prettier-plugin-toml
|
2023-08-20 10:11:45 +02:00
|
|
|
#"prettier-plugin-toml@1.0.0",
|
|
|
|
#]
|
2023-05-18 09:20:21 +02: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 08:48:06 +02:00
|
|
|
|
2023-05-18 10:58:51 +02:00
|
|
|
# Shell code formatter, requires Go
|
|
|
|
- repo: https://github.com/scop/pre-commit-shfmt
|
2023-06-25 13:18:37 +02:00
|
|
|
rev: v3.7.0-1
|
2023-05-18 10:58:51 +02:00
|
|
|
hooks:
|
|
|
|
- id: shfmt
|
|
|
|
#- id: shfmt-docker
|
|
|
|
|
2023-04-05 08:48:06 +02:00
|
|
|
# .editorconfig validity checking
|
2023-02-21 18:28:28 +01:00
|
|
|
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
|
2023-06-25 13:18:37 +02:00
|
|
|
rev: "2.7.2"
|
2023-02-21 17:23:28 +01:00
|
|
|
hooks:
|
2023-02-21 18:28:28 +01:00
|
|
|
- id: editorconfig-checker
|
2023-02-21 17:23:28 +01:00
|
|
|
alias: ec
|
2023-04-04 08:47:06 +02:00
|
|
|
# I don't actually care about line lengths as more than a guideline
|
|
|
|
args: [-disable-max-line-length]
|
2023-05-18 10:33:33 +02:00
|
|
|
exclude: .*\.nginx$
|
2023-05-18 09:17:01 +02:00
|
|
|
|
2023-05-18 09:20:21 +02:00
|
|
|
# # Python linter
|
|
|
|
# - repo: local
|
|
|
|
# hooks:
|
|
|
|
# - id: pylint
|
|
|
|
# name: pylint
|
|
|
|
# entry: pylint
|
|
|
|
# language: system
|
|
|
|
# types_or: [python, pyi]
|
2023-05-20 12:15:16 +02:00
|
|
|
|
|
|
|
# # Checking that LaTeX compiles
|
|
|
|
# - repo: local
|
|
|
|
# hooks:
|
|
|
|
# - id: latexmk
|
|
|
|
# name: latexmk
|
|
|
|
# entry: latexmk -quiet
|
|
|
|
# language: system
|
|
|
|
# types: [text, tex]
|
2023-06-04 10:41:12 +02:00
|
|
|
|
|
|
|
# Fedora: perl-Image-ExifTool
|
|
|
|
# - repo: local
|
|
|
|
# hooks:
|
|
|
|
# - id: exiftool
|
|
|
|
# name: Remove all EXIF metadata using exiftool
|
|
|
|
# entry: exiftool -all=
|
|
|
|
# language: system
|
|
|
|
# types: [image]
|