rtk-ai/rtk

gradle.toml keeps generic Gradle runtime chatter that is not build signal

Open

#1178 aperta il 10 apr 2026

Vedi su GitHub
 (3 commenti) (0 reazioni) (0 assegnatari)Rust (2914 fork)batch import
area:configbugeffort-smallfilter-qualitygood first issuehelp wantedpriority:low

Metriche repository

Star
 (48.085 star)
Metriche merge PR
 (Merge medio 11g 1h) (45 PR mergiate in 30 g)

Descrizione

The current TOML Gradle filter keeps generic Gradle runtime chatter that is not usually useful build signal.

MWE

tmp=$(mktemp -d)
mkdir -p "$tmp/home/Library/Application Support/rtk" "$tmp/proj"

cat > "$tmp/home/Library/Application Support/rtk/filters.toml" <<'EOF'
schema_version = 1
[filters.gradle]
description = "Compact Gradle build output — strip progress, keep tasks and errors"
match_command = "^(?:\\./)?gradlew?\\b"
strip_ansi = true
strip_lines_matching = [
  "^\\s*$",
  "^> Configuring project",
  "^> Resolving dependencies",
  "^> Transform ",
  "^Download(ing)?\\s+http",
  "^\\s*<-+>\\s*$",
  "^> Task :.*UP-TO-DATE$",
  "^> Task :.*NO-SOURCE$",
  "^> Task :.*FROM-CACHE$",
  "^Starting a Gradle Daemon",
  "^Daemon will be stopped",
]
truncate_lines_at = 150
max_lines = 50
on_empty = "gradle: ok"
EOF

HOME="$tmp/home" gradle -p "$tmp/proj" init --type basic --dsl kotlin --project-name mwe --use-defaults
cd "$tmp/proj"

HOME="$tmp/home" RTK_TOML_DEBUG=1 rtk ./gradlew help
# actual includes:
# Calculating task graph as no cached configuration is available for tasks: help
# Reusing configuration cache.
# Configuration cache entry stored/reused.

Expected Keep the task result and help text, but drop generic runtime lines such as:

  • Calculating task graph ...
  • Reusing configuration cache.
  • Configuration cache entry stored/reused.

Debug

RTK_TOML_DEBUG=1 rtk ./gradlew help
RTK_TOML_DEBUG=1 rtk ./gradlew tasks

Local workaround Extend strip_lines_matching with patterns for generic cache/task-graph chatter.

Proposed fix in rtk

  • Add inline tests for help / tasks output with configuration-cache lines.
  • Strip generic non-build-signal runtime lines while preserving task output, warnings, and real errors.
  • Use earlier Gradle filter intent as guidance: older Gradle work explicitly treated generic task-progress noise as removable, e.g. PR #374, PR #381, PR #709.

Context

  • Current TOML filter came from PR #635.
  • Related: #1177.

Guida contributor