Skip to content

Conversation

@MahdiBM
Copy link
Contributor

@MahdiBM MahdiBM commented Jul 15, 2025

Description

I'm using VSCode/Cursor and everytime a format-on-save is triggered, the whole file gets formatted.
This is not good because I have some incoming PRs that make logic changes, and I don't want to make them harder to review that they already are.
If needed i can set up swift-format CI in a separate CI to make sure the project remains swift-formatted.

Feel free to review on your own schedule.

How Has This Been Tested?

Please describe the tests that you ran to verify your changes.

Minimal checklist:

  • I have performed a self-review of my own code
  • I have added DocC code-level documentation for any public interfaces exported by the package
  • I have added unit and/or integration tests that prove my fix is effective or that my feature works

@codecov
Copy link

codecov bot commented Jul 15, 2025

Codecov Report

❌ Patch coverage is 74.41406% with 262 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.41%. Comparing base (3db567f) to head (2e92a79).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
Sources/Benchmark/BenchmarkMetric+Defaults.swift 44.71% 47 Missing ⚠️
Sources/Benchmark/Benchmark.swift 42.37% 34 Missing ⚠️
...ark/MallocStats/MallocStatsProducer+jemalloc.swift 52.78% 34 Missing ⚠️
...urces/Benchmark/BenchmarkThresholds+Defaults.swift 21.95% 32 Missing ⚠️
.../Benchmark/Benchmark+ConvenienceInitializers.swift 0.00% 30 Missing ⚠️
Sources/Benchmark/OutputSuppressor.swift 0.00% 26 Missing ⚠️
Sources/Benchmark/BenchmarkRunner.swift 56.25% 21 Missing ⚠️
Sources/Benchmark/BenchmarkExecutor.swift 82.67% 13 Missing ⚠️
Sources/Benchmark/NIOConcurrencyHelpers/lock.swift 42.86% 8 Missing ⚠️
Sources/Benchmark/Progress/Progress.swift 14.29% 6 Missing ⚠️
... and 5 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #328      +/-   ##
==========================================
- Coverage   69.48%   69.41%   -0.07%     
==========================================
  Files          33       33              
  Lines        3938     4053     +115     
==========================================
+ Hits         2736     2813      +77     
- Misses       1202     1240      +38     
Files with missing lines Coverage Δ
Sources/Benchmark/ARCStats/ARCStats.swift 100.00% <100.00%> (ø)
Sources/Benchmark/ARCStats/ARCStatsProducer.swift 85.29% <100.00%> (+0.92%) ⬆️
Sources/Benchmark/BenchmarkClock.swift 30.14% <100.00%> (-3.58%) ⬇️
Sources/Benchmark/BenchmarkMetric.swift 62.57% <100.00%> (ø)
Sources/Benchmark/BenchmarkThresholds.swift 100.00% <100.00%> (ø)
Sources/Benchmark/MallocStats/MallocStats.swift 100.00% <100.00%> (ø)
Sources/Benchmark/Progress/ProgressElements.swift 92.54% <100.00%> (+0.11%) ⬆️
Tests/BenchmarkTests/BenchmarkMetricsTests.swift 97.75% <100.00%> (-1.12%) ⬇️
Tests/BenchmarkTests/BenchmarkResultTests.swift 100.00% <100.00%> (ø)
Tests/BenchmarkTests/BenchmarkRunnerTests.swift 92.68% <100.00%> (+0.38%) ⬆️
... and 18 more
Files with missing lines Coverage Δ
Sources/Benchmark/ARCStats/ARCStats.swift 100.00% <100.00%> (ø)
Sources/Benchmark/ARCStats/ARCStatsProducer.swift 85.29% <100.00%> (+0.92%) ⬆️
Sources/Benchmark/BenchmarkClock.swift 30.14% <100.00%> (-3.58%) ⬇️
Sources/Benchmark/BenchmarkMetric.swift 62.57% <100.00%> (ø)
Sources/Benchmark/BenchmarkThresholds.swift 100.00% <100.00%> (ø)
Sources/Benchmark/MallocStats/MallocStats.swift 100.00% <100.00%> (ø)
Sources/Benchmark/Progress/ProgressElements.swift 92.54% <100.00%> (+0.11%) ⬆️
Tests/BenchmarkTests/BenchmarkMetricsTests.swift 97.75% <100.00%> (-1.12%) ⬇️
Tests/BenchmarkTests/BenchmarkResultTests.swift 100.00% <100.00%> (ø)
Tests/BenchmarkTests/BenchmarkRunnerTests.swift 92.68% <100.00%> (+0.38%) ⬆️
... and 18 more

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc7e44d...2e92a79. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hassila
Copy link
Contributor

hassila commented Jul 17, 2025

Need to check that this is workable with Xcode's formatting too - otherwise the reverse problem will exist...

@MahdiBM
Copy link
Contributor Author

MahdiBM commented Jul 17, 2025

@hassila Xcode doesn't have any particular problem with this I think.
I haven't used Xcode much lately, but I also never noticed it making problems.
Usually Xcode doesn't force it's own formatting.

The Apple repositories have all moved to enforcing swift-format and I know not all of them use non-Xcode IDEs.

I'll check to make sure soon, but I'm fairly certain we should be fine.

@hassila hassila requested a review from Copilot August 25, 2025 11:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR applies automated swift-format formatting to fix code style inconsistencies across the codebase. The formatting includes proper line breaks, trailing commas, import organization, and consistent indentation/spacing throughout test files and source code.

  • Reorganizes import statements to follow standard ordering
  • Adds trailing commas in multi-line collections and function parameters
  • Fixes line breaks and indentation for better readability

Reviewed Changes

Copilot reviewed 56 out of 60 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Tests/BenchmarkTests/*.swift Applies formatting fixes to test files including import reordering and trailing commas
Sources/Benchmark/*.swift Formats source files with proper line breaks, trailing commas, and function parameter alignment
Plugins/BenchmarkTool/*.swift Standardizes formatting in plugin tool files
Plugins/BenchmarkCommandPlugin/*.swift Applies consistent formatting to command plugin files
Package.swift and Benchmarks/Package.swift Formats package manifest files with proper trailing commas
.swift-format and .swiftlint_refinement.yml Adds swift-format configuration and updates SwiftLint rules

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@hassila hassila merged commit 5c3a2ee into ordo-one:main Aug 25, 2025
14 of 16 checks passed
@hassila
Copy link
Contributor

hassila commented Aug 25, 2025

Thanks!

@hassila
Copy link
Contributor

hassila commented Aug 25, 2025

Probably should add some docs if you are up for it for contributions or run CI job with swift-format -i --recursive .. WDYT?
Ping @freef4ll wrt CI.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants