Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SwiftFormat to the project. #129

Merged
merged 5 commits into from
Jul 6, 2022
Merged

Add SwiftFormat to the project. #129

merged 5 commits into from
Jul 6, 2022

Conversation

pixlwave
Copy link
Member

@pixlwave pixlwave commented Jul 1, 2022

This PR adds SwiftFormat to the project as a build phase and runs it for the first time. I've gone for a regular pre-build phase on the main target which the docs don't particularly recommend (instead suggesting to use a step on the tests target). Seems like this should be ok for now, but happy to update now if deemed sensible.

Another option would be to never run manually, instead using Danger to inform you to run it on a PR.

@github-actions
Copy link

github-actions bot commented Jul 1, 2022

Changes in 129 (2022-07-06)

✨ Features

  • Implement rageshake service. (#23)
  • Add filtering for rooms by name. (#26)
  • Settings screen minimal implementation. (#37)
  • DesignKit: Add initial implementation of DesignKit to the repo as a Swift package. (#43)
  • Room timeline: Add plain styler and add timeline option in settings screen. (#92)
  • Implement and use background tasks. (#99)

🙌 Improvements

  • Implement new ClientBuilder pattern for login (#120)
  • Flatten the room list by removing the encrypted groups. (#121)
  • Add AuthenticationService and missing UI tests on the flow. (#126)
  • Room: Use bubbles in the timeline. (#34)
  • Room: Add header view containing room avatar and encryption badge. (#35)
  • Add the splash, login and server selection screens from Element iOS along with a UserSessionStore. (#40)
  • DesignKit: Add DesignKit to the ElementX project, style the login screen with it and tint the whole app. (#43)
  • Settings: Auto dismiss bug report screen and show a success indicator when bug report completed. (#76)
  • Bug report: Add GH labels. (#77)
  • Danger: Add a check for png files and warn to use SVG and PDF files. (#87)
  • Add localizations to UI tests target and add some checks. (#101)

🐛 Bugfixes

  • ElementInfoPlist: Use custom template for Info.plist. (#71)

🧱 Build

  • Add swiftformat to the project and run it for the first time. (#129)
  • Use v0.0.1 of the DesignTokens package. (#78)
  • Update to v0.0.2 of the DesignTokens package. (#90)
  • Fix Danger's changelog detection. (#74)

Others

  • Add Screen as a suffix to all screens and tidy up the template. (#125)
  • Fix project urls in Towncrier configuration. (#96)

📱 Scan the QR code below to install the build for this PR.
🔒 This build is for internal testing purpose. Only devices listed in the ad-hoc provisioning profile can install Element Alpha.

QR code

If you can't scan the QR code you can install the build via this link: https://i.diawi.com/NUwDSY

@pixlwave pixlwave force-pushed the doug/swiftformat branch from c961339 to 70faaeb Compare July 1, 2022 17:16
@pixlwave pixlwave changed the title Run swiftformat . --swiftversion 5.6 Add .swiftformat and run on project Jul 1, 2022
@github-actions
Copy link

github-actions bot commented Jul 1, 2022

Warnings
⚠️ This pull request seems relatively large. Please consider splitting it into multiple smaller ones.
⚠️ Some of the commits are missing ticket numbers. Please consinder using them for better tracking.
⚠️ You seem to have made changes to views. Please consider adding screenshots.
⚠️

UnitTests/Sources/AttributedStringBuilderTests.swift#L251 - where clauses are preferred over a single if inside a for. (for_where)

⚠️

UnitTests/Sources/AttributedStringBuilderTests.swift#L277 - where clauses are preferred over a single if inside a for. (for_where)

⚠️

UnitTests/Sources/AttributedStringBuilderTests.swift#L333 - where clauses are preferred over a single if inside a for. (for_where)

⚠️

UnitTests/Sources/AttributedStringBuilderTests.swift#L362 - where clauses are preferred over a single if inside a for. (for_where)

⚠️

UnitTests/Sources/AttributedStringBuilderTests.swift#L382 - where clauses are preferred over a single if inside a for. (for_where)

Generated by 🚫 Danger Swift against 22f2591

@pixlwave pixlwave force-pushed the doug/swiftformat branch 2 times, most recently from 8ade9ac to 70aaf9c Compare July 4, 2022 08:54
@pixlwave pixlwave requested a review from ismailgulek July 4, 2022 08:56
@@ -15,8 +15,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {

// fixme: Use `Bundle.elementLanguage = ".."` when we have the functionality
// use `en` as fallback language
// FIXME: Use `Bundle.elementLanguage = ".."` when we have the functionality
Copy link
Contributor

Choose a reason for hiding this comment

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

We could remove this at all.

Copy link
Contributor

@ismailgulek ismailgulek left a comment

Choose a reason for hiding this comment

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

Looks pretty good to me.

Copy link
Member Author

@pixlwave pixlwave left a comment

Choose a reason for hiding this comment

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

Thanks for your comments, rule wise they all seem like false positives to me, have fixed them.

ElementX/Sources/Other/ImageAnonymizer.swift Show resolved Hide resolved
.swiftformat Show resolved Hide resolved
ElementX/Sources/Other/Routers/RootRouter.swift Outdated Show resolved Hide resolved
ElementX/Sources/Other/Logging/MXLog.swift Outdated Show resolved Hide resolved
@@ -15,8 +15,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

func application(_ application: UIApplication, willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {

// fixme: Use `Bundle.elementLanguage = ".."` when we have the functionality
// use `en` as fallback language
// FIXME: Use `Bundle.elementLanguage = ".."` when we have the functionality
Copy link
Member Author

Choose a reason for hiding this comment

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

Will do

@codecov-commenter
Copy link

codecov-commenter commented Jul 5, 2022

Codecov Report

Merging #129 (22f2591) into develop (26d8aff) will increase coverage by 0.00%.
The diff coverage is 38.82%.

@@           Coverage Diff            @@
##           develop     #129   +/-   ##
========================================
  Coverage    35.57%   35.58%           
========================================
  Files          166      166           
  Lines        11524    11498   -26     
  Branches      5635     5631    -4     
========================================
- Hits          4100     4091    -9     
+ Misses        7333     7316   -17     
  Partials        91       91           
Impacted Files Coverage Δ
...Kit/Sources/Buttons/ElementActionButtonStyle.swift 50.90% <0.00%> (ø)
...nKit/Sources/Buttons/ElementGhostButtonStyle.swift 44.06% <ø> (ø)
DesignKit/Sources/Shapes/RoundedCornerShape.swift 0.00% <ø> (ø)
...t/Sources/TextFields/BorderedInputFieldStyle.swift 55.00% <0.00%> (ø)
...Kit/Sources/TextFields/ElementTextFieldStyle.swift 49.15% <ø> (ø)
ElementX/Sources/AppCoordinator.swift 0.00% <ø> (ø)
ElementX/Sources/AppCoordinatorStateMachine.swift 0.00% <0.00%> (ø)
ElementX/Sources/Other/Benchmark.swift 0.00% <ø> (ø)
ElementX/Sources/Other/BlurHashDecode.swift 0.00% <0.00%> (ø)
ElementX/Sources/Other/Extensions/String.swift 93.33% <ø> (ø)
... and 117 more

Continue to review full report at Codecov.

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

@pixlwave pixlwave force-pushed the doug/swiftformat branch from c6af245 to e47369a Compare July 5, 2022 15:59
@pixlwave pixlwave changed the title Add .swiftformat and run on project Add SwiftFormat to the project. Jul 5, 2022
@pixlwave pixlwave marked this pull request as ready for review July 5, 2022 16:14
@pixlwave pixlwave force-pushed the doug/swiftformat branch from bbd92a4 to 22f2591 Compare July 6, 2022 08:18
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 6, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 3 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@pixlwave pixlwave requested a review from ismailgulek July 6, 2022 08:21
Copy link
Contributor

@ismailgulek ismailgulek left a comment

Choose a reason for hiding this comment

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

Thanks, it's great to have this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants