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 SwiftLint rule to enforce stack spacing. #2080

Merged
merged 6 commits into from
Nov 14, 2023
Merged

Conversation

pixlwave
Copy link
Member

@pixlwave pixlwave commented Nov 14, 2023

As part of #2007 I noticed that nested stack behaviour has changed when building with the new SDK. Whilst we're still waiting for a solution on the CI side, this PR adds SwiftLint rules to ensure all HStack and VStacks have the spacing parameter (and then goes through the codebase and fixes them by adding spacing and watching the preview to get the right value).

Some snapshots have changed as a result of preview stacks and so don't reflect changes in the app. There are some layout changes to the plain timeline style too:

  • There was random trailing spacing meaning that items didn't line up with the trailing edge of the timestamp. This is now fixed.
  • The spacing between the thread decorator, reply preview and message has ended up collapsing slightly. We don't have designs so there's nothing to go on here, but it helps pull all the content from the same message together to me.

@pixlwave pixlwave requested a review from a team as a code owner November 14, 2023 10:56
@pixlwave pixlwave requested review from Velin92 and removed request for a team November 14, 2023 10:56
Copy link

github-actions bot commented Nov 14, 2023

Warnings
⚠️ Some of the commits are missing ticket numbers. Please consider squashing all commits that don't have a tracking number.
⚠️ You seem to have made changes to views. Please consider adding screenshots.

Generated by 🚫 Danger Swift against 8e54c43

Copy link

codecov bot commented Nov 14, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (4257c20) 69.93% compared to head (57a6635) 69.90%.
Report is 1 commits behind head on develop.

❗ Current head 57a6635 differs from pull request most recent head 8e54c43. Consider uploading reports for the commit 8e54c43 to get more accurate results

Files Patch % Lines
...Sources/Other/MapLibre/MapLibreStaticMapView.swift 0.00% 1 Missing ⚠️
...ources/Other/SwiftUI/Layout/FullscreenDialog.swift 66.66% 1 Missing ⚠️
...oserToolbar/View/VoiceMessagePreviewComposer.swift 91.66% 0 Missing and 1 partial ⚠️
...mMemberListScreen/View/RoomMembersListScreen.swift 50.00% 1 Missing ⚠️
...KeyScreen/View/SecureBackupRecoveryKeyScreen.swift 90.90% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2080      +/-   ##
===========================================
- Coverage    69.93%   69.90%   -0.03%     
===========================================
  Files          518      518              
  Lines        36166    36139      -27     
  Branches     17525    17510      -15     
===========================================
- Hits         25292    25263      -29     
- Misses       10223    10224       +1     
- Partials       651      652       +1     
Flag Coverage Δ
unittests 54.33% <95.72%> (-0.14%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Xcode 15 changes the default behaviour and given we're always working from designs, we shouldn't rely on it for our layout.
@pixlwave pixlwave force-pushed the doug/lint-stack-spacing branch from 57a6635 to 3e6bfd9 Compare November 14, 2023 12:11
Copy link

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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@pixlwave pixlwave enabled auto-merge (squash) November 14, 2023 12:20
@pixlwave pixlwave merged commit 2c1e61a into develop Nov 14, 2023
@pixlwave pixlwave deleted the doug/lint-stack-spacing branch November 14, 2023 12:38
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.

2 participants