#!/usr/bin/env bash set -xu target=${1:?} instructions=$(mktemp) echo "Fix the following lint errors, or silence them with a `# noqa:` comment if they aren't problematic:" >> "$instructions" if lint -f "$target" >> "$instructions" 2>&1 then echo "no bad lints" else aider --yes --message-file "$instructions" "$target" fi