STREGAsGate / GateEngine

Swift Game Engine supporting Windows, Linux, macOS, HTML5, and more 🚂
Apache License 2.0
280 stars 6 forks source link

Add SwiftLint and configure for Style #30

Closed MadGeorge closed 10 months ago

MadGeorge commented 1 year ago

Hi! Did not find any references to a linter and code style guides in the repo. It would be nice to have while the project does not become large and many other contributors joined the repository.

To not go too hard on a code style I would suggest using the existing one https://google.github.io/swift/ and for the linter SwiftLint. These two are battle-tested and used in many projects.

Feel free to close this issue without a response.

STREGA commented 1 year ago

I like it. I don't think I'll adopt a textbook of style requirements, but I'll look into SwiftLint and see if it can be configured to enforce a coding style to make it easier for contributors in the future.

gregcotten commented 12 months ago

Just simply running

brew install swiftformat
swiftformat --swiftversion 5.8.1 .

and seeing what has changed could give you some ideas on what style guidelines you like/dislike.

I will probably mirror this repo with (mostly) swiftformat guidelines on top as I like their default rules and it is widely adopted, making the readability much better.

STREGA commented 11 months ago

I'll look at swift-format too. I'll likely go with the style and tool the majority of official swift projects are using.

Going to wait to implement the style until right before the documentation audit which will happen immediately before v1.0.0 is tagged.

STREGA commented 10 months ago

Using both SwiftLint and SwiftFormat. Fixing all format issues will take some time and completion will be recorded in #43. Closing this.