New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: flag for exiting 1 if changes proposed #23
Comments
Hi @Goorzhel, thanks for the suggestion. I think this feature won't be too hard to implement, but could you share the scenarios where this comes handy? Usually I would love to learn the actual scenarios before adding new features so that maybe there's a better way to do it. |
I use (EDIT: I realized while writing that paragraph that I should actually be using format-on-write, but I haven't set it up yet. My point about |
I see. I assume you're running beancount-black from https://github.com/LaunchPlatform/beancount-black/blob/master/.pre-commit-hooks.yaml One can write a repos:
- repo: https://github.com/LaunchPlatform/beancount-black
rev: 1.0.0
hooks:
- id: beancount-black then run pre-commit install to make it works. It does the file change check and aborting commit for you automatically. Would you prefer to use pre-commit instead or is there any particular reason you would rather use raw git pre-commit hook? |
I hadn't seen that, nor am I familiar with And yes, I have a script in .git/hooks/pre-commit#!/usr/bin/env -S bash -e
ag '^#!.*python' bin -l | xargs black -q --check
read -ra changed_bc_files < <(git diff --cached --name-only --diff-filter=ACM \
| grep beancount$ | paste -sd " " )
if [ "${#changed_bc_files[@]}" -gt 0 ]; then
bean-black -n "${changed_bc_files[@]}"
fi |
|
Similar to:
The text was updated successfully, but these errors were encountered: