| 1 | #!/bin/bash |
| 2 | set -e |
| 3 | cd "$(dirname "$0")" |
| 4 | cd .. |
| 5 | |
| 6 | for i in cw_bitcoin cw_bitcoin_cash cw_core cw_decred cw_dogecoin cw_evm cw_monero cw_mweb cw_nano cw_solana cw_tron cw_zano cw_zcash lib; |
| 7 | do |
| 8 | { |
| 9 | # files modified after the lints got enabled and committed |
| 10 | git log --since="2026-07-14 23:59:59" --name-only --diff-filter=d --format="" -- "$i" |
| 11 | # uncommitted files (assumed to have been modified after the 29th) |
| 12 | git diff --name-only --diff-filter=d HEAD -- "$i" |
| 13 | } | grep '\.dart$' | sort -u | while IFS= read -r file; do |
| 14 | echo $file |
| 15 | if [[ -f "$file" ]]; then |
| 16 | dart fix --apply "$file" && dart format --line-length=100 "$file" |
| 17 | fi |
| 18 | done |
| 19 | |
| 20 | if [[ -n "$ABORT_ON_CHANGE" ]]; then |
| 21 | DART_CHANGES=$(git status --porcelain -- "$i" | grep '\.dart$' || true) |
| 22 | |
| 23 | if [[ -n "$DART_CHANGES" ]]; then |
| 24 | echo "Please run scripts/lint.sh" |
| 25 | echo "changes in $i:" |
| 26 | echo "$DART_CHANGES" |
| 27 | exit 1 |
| 28 | fi |
| 29 | fi |
| 30 | done |