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

SwiftLint integration #90

Merged
merged 4 commits into from
Nov 15, 2023

Conversation

Garfeild
Copy link
Contributor

@Garfeild Garfeild commented Nov 1, 2023

This PR introduces SwiftLint to the project and fixes majority of lint warnings. SwiftLint is integrated as Xcode Plugin to ensure every contributor is using it.

Resolves #86

@Garfeild Garfeild force-pushed the feat/swiftlint-integration branch 2 times, most recently from ec6702b to 98f585f Compare November 2, 2023 18:44
@Garfeild Garfeild force-pushed the feat/swiftlint-integration branch from 98f585f to 5762809 Compare November 7, 2023 20:17
@Garfeild Garfeild marked this pull request as ready for review November 7, 2023 20:21
@Garfeild Garfeild changed the title DRAFT SwiftLint integration SwiftLint integration Nov 7, 2023
Copy link
Owner

@okwasniewski okwasniewski left a comment

Choose a reason for hiding this comment

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

Overall looks good! Thanks for this improvement, left few questions

MiniSim/Model/Platform.swift Show resolved Hide resolved
.swiftlint.yml Show resolved Hide resolved
@okwasniewski
Copy link
Owner

When it comes to auto formatting the code in Xcode for example on save. Is it possible with SwiftLint only or do we need something like SwiftFormat for that? We can add auto formatting in a separate PR but Im not that familliar with Swift tooling

@Garfeild
Copy link
Contributor Author

When it comes to auto formatting the code in Xcode for example on save. Is it possible with SwiftLint only or do we need something like SwiftFormat for that? We can add auto formatting in a separate PR but Im not that familliar with Swift tooling

It's possible for sure. There are two ways of doing it, both will require to use binary and some small shell script in Xcode project itself.

  • Use binary available on developer machine and throw error if it's missing. Biggest downside, folks will have to install exact version, which could be tricky for Homebrew users (there is no notion of pinned versions). Different versions also might have different set of rules (in many cases new rules are added).
  • Add binary to the repository so we always have the right version. Problem? Well, we will have binary file in the repository, which is not a big of an issue overall.

Copy link
Owner

@okwasniewski okwasniewski 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 explaining and huge amount of work! Let's for now use only SwiftLint as it's a big improvement itself.

I've created separate issues to enable each commented out rule:

@okwasniewski okwasniewski merged commit e177eec into okwasniewski:main Nov 15, 2023
@Garfeild Garfeild deleted the feat/swiftlint-integration branch November 16, 2023 16:09
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.

Add SwiftLint to codebase
2 participants