witty-crayon-22786
03/26/2021, 12:20 AMwitty-crayon-22786
03/26/2021, 12:22 AM./pants fmt
manually. but interested in whether folks have different strategies!busy-vase-39202
03/26/2021, 2:01 AMloud-stone-83419
03/26/2021, 1:15 PM#!/usr/bin/env bash
# NB: pre-commit runs in the context of GIT_WORK_TREE, ie: pwd == REPO_ROOT
changed=("$(./pants --changed-fast --changed-parent=HEAD list)")
./pants fmt ${changed}
clean-city-64472
03/26/2021, 1:47 PM/bin/bash
./pants lint --changed-since=HEAD || exit 1
I added these aliases to my bashrc
alias fmt='./pants --changed-since=master fmt'
alias lint='./pants --changed-since=master lint'
witty-crayon-22786
03/26/2021, 6:53 PMwitty-crayon-22786
03/26/2021, 6:53 PMwitty-crayon-22786
03/26/2021, 6:53 PMloud-stone-83419
03/26/2021, 6:54 PMwitty-crayon-22786
03/26/2021, 6:54 PMloud-stone-83419
03/26/2021, 6:54 PMloud-stone-83419
03/26/2021, 6:54 PM