Skip to content

feat(swift): comprehensive Swift ecosystem filters (#848)#852

Open
pszymkowiak wants to merge 2 commits intodevelopfrom
feat/swift-ecosystem
Open

feat(swift): comprehensive Swift ecosystem filters (#848)#852
pszymkowiak wants to merge 2 commits intodevelopfrom
feat/swift-ecosystem

Conversation

@pszymkowiak
Copy link
Copy Markdown
Collaborator

Summary

Adds 5 TOML filters + rewrite rules for the Swift ecosystem. Closes #848.

Command Filter Savings
swift test Strip passing tests, show failures + summary 80-85%
swift package resolve/update Strip Fetching/Resolving noise 80-90%
swift run Strip build noise, show app output 70-80%
swiftlint Strip Linting noise, show violations 75%
swiftformat Short-circuit on no changes, show changed files 70%

Rewrite rules added

  • swift (build|test|run|package)rtk swift ...
  • swiftlintrtk swiftlint
  • swiftformatrtk swiftformat

Also fixes

  • Pre-existing cargo fmt issues in diff_cmd.rs, init.rs
  • Pre-existing clippy warning in rake_cmd.rs (map_oris_some_and)

Test plan

  • 1119 tests passed, 0 failed
  • cargo fmt clean
  • cargo clippy clean
  • All 5 TOML filters have inline tests (10 test cases total)
  • Rewrite tests for swift test, swiftlint, swiftformat, swift package

TOML filters:
- swift-test.toml: strip passing tests, show failures + summary
- swift-package.toml: strip Fetching/Resolving noise (resolve, update)
- swift-run.toml: strip build noise, show app output
- swiftlint.toml: strip Linting noise, show violations
- swiftformat.toml: strip noise, short-circuit on no changes

Rewrite rules:
- swift (build|test|run|package) → rtk swift ...
- swiftlint → rtk swiftlint
- swiftformat → rtk swiftformat

Also fixes pre-existing cargo fmt/clippy issues in diff_cmd.rs,
init.rs, and rake_cmd.rs (map_or → is_some_and).

1119 tests passed, 0 failed.

Signed-off-by: Patrick szymkowiak <[email protected]>
@pszymkowiak pszymkowiak added effort-medium 1-2 jours, quelques fichiers enhancement New feature or request labels Mar 26, 2026
@pszymkowiak
Copy link
Copy Markdown
Collaborator Author

[w] wshm · Automated triage by AI

📊 Automated PR Analysis

Type feature
🟢 Risk low

Summary

Adds comprehensive Swift ecosystem support with 5 new TOML filters (swift test, swift package, swift run, swiftlint, swiftformat) and corresponding rewrite rules. Also includes minor pre-existing formatting and clippy fixes in unrelated files.

Review Checklist

  • Tests present
  • Breaking change
  • Docs updated

Linked issues: #848


Analyzed automatically by wshm · This is an automated analysis, not a human review.

Strip [N/M] progress lines, 'Building for debugging...', and
'Build of product' lines from macOS swift build/test/run output.
Tested on real Swift API project on macOS.

Signed-off-by: Patrick szymkowiak <[email protected]>
@aeppling
Copy link
Copy Markdown
Contributor

Hey

We are cleaning up the codebase and improving the project structure for better onboarding. As part of this effort, PR #826 reorganizes src/ from a flat layout into subfolders.

No logic changes — only file moves and import path updates.

What you need to do

Rebase your branch on develop when receiving this comment:

git fetch origin && git rebase origin/develop

Git detects renames automatically. If you get import conflicts, update the paths:

use crate::git;        // now: use crate::cmds::git::git;
use crate::tracking;   // now: use crate::core::tracking;
use crate::config;     // now: use crate::core::config;
use crate::init;       // now: use crate::hooks::init;
use crate::gain;       // now: use crate::analytics::gain;

Need help rebasing? Tag @aeppling

@aeppling
Copy link
Copy Markdown
Contributor

aeppling commented Mar 28, 2026

@pszymkowiak

Need rebase after the folder re-organisation

BUG 1: swift-package.toml: match_output never fires

^Resolved uses a start-of-string anchor but the engine runs match_output before strip_lines. The blob starts with "Fetching...", not "Resolved". Regex is compiled without the multiline flag (Regex::new() at toml_filter.rs:349). Result: users get 3 lines of Computed/Resolved output instead of "ok (dependencies resolved)".

BUG 2: swiftlint.toml: violations summary stripped

^Done linting! strip pattern matches all "Done linting!" lines — including "Done linting! Found 3 violations, 1 serious". The violation count summary is lost. Test expects the summary in output but it's actually stripped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort-medium 1-2 jours, quelques fichiers enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants