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

Set up SwiftLint #693

Merged
merged 8 commits into from
Feb 26, 2024
Merged

Set up SwiftLint #693

merged 8 commits into from
Feb 26, 2024

Conversation

mokagio
Copy link
Contributor

@mokagio mokagio commented Jan 17, 2024

Description

Sets up SwiftLint in the project, so it runs via build phase and can also run locally via Fastlane.

Context: I'm going through our Swift codebases to ensure:

  • SwiftLint is used locally
  • SwiftLint is used in CI
  • Hound is disabled

Testing Details

Add some empty lines in a Swift file then build, you should see a warning.

image

Run bundle exec fastlane lint. It should fail:

image

Run bundle exec fastlane format. It should pass and the empty line should be gone from Xcode

image
  • Please check here if your pull request includes additional test coverage. – N.A.
  • I have considered if this change warrants release notes and have added them to the appropriate section in the CHANGELOG.md if necessary. – N.A.

@mokagio
Copy link
Contributor Author

mokagio commented Jan 18, 2024

Thank you for the review @crazytonyli . FYI, I might hold onto this and try a different approach via SPM. We'll see...

@mokagio mokagio disabled auto-merge January 18, 2024 23:08
@mokagio
Copy link
Contributor Author

mokagio commented Feb 8, 2024

I used SwiftLint via SPM in wordpress-mobile/WordPress-iOS-Shared#344. It works well for libraries that are configured as Swift Packages, because you can add it to Package.swift. This one isn't so I'd rather stick with the CocoaPods approach for the time being.

@iangmaia iangmaia merged commit 12ca8d5 into trunk Feb 26, 2024
9 checks passed
@iangmaia iangmaia deleted the mokagio/setup-swiftlint branch February 26, 2024 14:52
@observableobject
Copy link

Well done!

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.

4 participants