Skip to content

Coding Standards

phchang edited this page May 3, 2016 · 9 revisions

GeoFeatures2 Coding Standards

New code added to an existing file must follow the predominant style of that file. All new code must follow the current standards listed here. The goal of these standards are consistency and readability of the code base, even though there may be many different authors.

Libraries

GeoFeatures2 relies only on pure Swift – no third party libraries are to be used, including Foundation. Be careful to replace import Foundation with import Swift when creating new files in Xcode.

Comments

Any code that is of public scope must have comments following Apple's Markup Formatting Reference.

Callouts

When commenting a method with callouts – return value, parameters, throws, etc. – the callout should be lowercased preceded by a dash and a single space.

Example:

- precondition: The "outerRing" must be oriented clockwise

Unit Tests

Code submitted to must be covered by unit tests, otherwise your pull request will not be approved.

See Unit Test Requirements.

Contributions

Pull Requests

  1. Fork the GeoFeatures2 repository.
  2. Create your feature branch: git checkout -b my-new-feature.
  3. Commit your changes: git commit -am 'A concise description of your commit'.
  4. Push your changes upstream: git push origin my-new-feature.
  5. Submit a pull request.