TheBLVD / mammoth

GNU Affero General Public License v3.0
183 stars 13 forks source link

Add SwiftLint to project #592

Closed billburgess closed 3 months ago

billburgess commented 3 months ago

I added SwiftLint support to this project. I opted for Homebrew installation as we are already using that for other dependencies and is the easiest for developers that are getting setup on the project.

This PR is best reviewed commit by commit as there are a lot of files with changes. I grouped the commits logically so all of the same changes were made in the same commit for easier readability.

Finally, we can haggle over the settings and how strict we want things to be going forward. I borrowed this SwiftLint config file from other projects I've used which was provided to the open source community to use. It's well documented and easy to understand which rules are in use and which are not.

Initial install of SwiftLint before any config changes:

Screenshot 2024-06-20 at 8 29 01 AM

After addition of config file:

Screenshot 2024-06-20 at 8 32 34 AM

Finally, after ignoring items we don't care about:

Screenshot 2024-06-20 at 8 47 46 AM

All breaking issues have been resolved. There are still many warnings throughout the app that can be addressed at a later time.

billburgess commented 3 months ago

@bnolens No, I disabled the 2 inline and left everything else. They are still there and will show up as compiler warnings. These came from some friends in the open source community and I've had good luck with them. They usually only need minor changes to get things right.