From e9eb3004999b025ac0f29b0b06dc036ef6419523 Mon Sep 17 00:00:00 2001 From: Ohad Livne Date: Wed, 4 Jun 2025 22:46:05 +0300 Subject: [PATCH] Set up pre-commit hooks --- .config/setup/01-install-packages.sh | 1 + .config/setup/02-setup-packages.sh | 2 ++ .pre-commit-config.yaml | 24 ++++++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.config/setup/01-install-packages.sh b/.config/setup/01-install-packages.sh index 9fd1b2f..ba97d6d 100755 --- a/.config/setup/01-install-packages.sh +++ b/.config/setup/01-install-packages.sh @@ -35,6 +35,7 @@ network-manager \ nmap \ pipx \ postfix \ +pre-commit \ pulseaudio \ pulseaudio-utils \ python3-poetry \ diff --git a/.config/setup/02-setup-packages.sh b/.config/setup/02-setup-packages.sh index 276b08a..9b11812 100755 --- a/.config/setup/02-setup-packages.sh +++ b/.config/setup/02-setup-packages.sh @@ -6,3 +6,5 @@ systemctl --user enable syncthing.service systemctl --user start syncthing.service mkdir -p ~/Pictures/screenshots + +pre-commit install diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..d5b3ea6 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,24 @@ +repos: +- repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-ast + - id: check-executables-have-shebangs + - id: check-toml + - id: check-yaml + - id: end-of-file-fixer + exclude: ^\.config/fcitx5/ + - id: trailing-whitespace +- repo: https://github.com/psf/black + rev: 22.10.0 + hooks: + - id: black +- repo: https://github.com/pycqa/isort + rev: 5.12.0 + hooks: + - id: isort +- repo: https://github.com/syntaqx/git-hooks + rev: v0.0.18 + hooks: + - id: forbid-binary + exclude: ^\.local/share/jupyter/kernels/python3\.12/logo-