Skip to content

Code Style Guide

Steve Ellis edited this page Mar 6, 2020 · 2 revisions

Golang

Try to folow idiomatic Golang style. For a brief overview, see the Code Review Comments and Effective Go for a more in depth review.

Use gofmt to format your code before checking it in.

TypeScript / TSX

We use Prettier and ESLint. If you are having trouble with linting on CI, try running yarn lint --fix.

General

Comments

In general, we try to minimize comments in the code base, in favor of tests and self documenting code. Having said that, there are some times when comments are appropriate, but please use them sparingly.

TODOs

Tasks left to do are better kept track of in our Tracker project, where they can be viewed in the context of the other work to do. However, sometimes it can be helpful to note future work or optimizations in the code. In this case, please open a Tracker story, tag it todo, and then leave a two line comment. With the first line being "TODO" followed by a short description, and the second line being a link to the Tracker story.

TODO: re-enable SA presence check when it does not exhaust the stack
https://www.pivotaltracker.com/story/show/171662440