Style and Conventions

General

Git / PRs

  • Each commit should have a single purpose
  • The pull request should be linear (avoid merging into private branches)
  • The pull request should be rebased onto the latest master (avoid conflict resolution in the merge commit)
  • The pull request should be reviewed by your peers before being merged to master
  • Each pull request should be merged to master without fast-forwards to keep a history of all merges

Scala

We use the official Scala Style Guide as a base for formatting.

Areas where we are differing from the style guide:

Imports:

scala
java
__blank line__
all other imports
__blank line__
io.narrative

An IntelliJ Scala Code Style Scheme is provided here to help with enforcing these guidelines.

Additional base guidelines we loosely follow:

VueJs

We use the official Vue Style Guide as a base for formatting.

Key clarification within the style guide:

2-Spaces per indentation

Within Vue files we will be using 2 spaces instead of tabs for indentation. Ideally setup your IDE to auto insert these for you.

Vuex within pages/components

Recommended way to reference getters and actions within pages or components is to use the mapGetters and mapActions helper functions from Vuex. These ensure we do not accidentally manipulate state from outside the Vuex Store.