There's a few rules that I follow when trying to maintain my own personal projects, these rules also expand to any future potential contributor or maintainer that help me along the way. Some rules are more specific when it comes to certain repositories, sometimes they're more lenient, but in general most these rules are just code and project formatting to begin with. If there is any rules that need to be extended due to contributors or maintainers (due to a large project) I will include a CONTRIBUTION.md
file that explains more on what you should do when contributing.
Below you will find the languages I have strict rules for when it comes to my personal projects, there could be one or even many. Just know that I will try to enforce these when possible.
- Avoid having any functions or variables at top level, for example avoid having a
func example() {}
inmain.swift
- Instead, you can make a static variable or function associated to an extension/class/enum to make them access