emqx / CocoaMQTT

MQTT 5.0 client library for iOS and macOS written in Swift
https://www.emqx.com/en
Other
1.57k stars 411 forks source link

Feature/align codestyle #513

Open spinnerok opened 1 year ago

spinnerok commented 1 year ago

In the first commit I have added a config file for swiftlint and aligned code to (almost) default config. In the second I have enabled some additional rules. Most of the changes in this PR are changes in white spaces and were made by swiftlint automatically.

spinnerok commented 1 year ago

@leeway1208 Can we merge this or discuss how to proceed? I can split commits in separate PRs or do every setting in a separate commit. Or should I adjust some rules?

leeway1208 commented 1 year ago

Hi. Sorry for late reply as we have CNY holiday break. I am not sure if .swiftlint.yml file has used the third part library and I may need to add New Run Script Phase in build phases? Thanks.

spinnerok commented 1 year ago

@leeway1208 Unfortunately swiftlint should be installed separately. It is not a part of a tool chain. You can install it using brew on MacOS.

brew install swiftlint

To run I just use the following command:

swiftlint lint --quiet

The quiet flag will hide all the processed files while still allows to see all issues.

And to adjust some simple deviations in style I use:

swiftlint --fix

For more information you can check a git repo.