dotfiles/.zsh/envs/python

21 lines
739 B
Plaintext

# -----------------------------------------------------------------------------
# "THE BEER-WARE LICENSE" (Revision 42):
# <florianbadie@odrling.xyz> wrote this file. As long as you retain this notice
# you can do whatever you want with this stuff. If we meet some day, and you
# think this stuff is worth it, you can buy me a beer in return. odrling
# -----------------------------------------------------------------------------
# shellcheck shell=bash
{
local possible_hooks=(ruff isort black pyright)
local hooks=()
for hook in ${possible_hooks[@]}; do
[ "$(git config odrhooks.$hook)" != 1 ] &&
grep $hook pyproject.toml &>/dev/null && hooks+=($hook)
done
DETECTED_HOOKS+="${hooks[@]}"
}