Skip to content

Developer guidelines

krasserm edited this page Mar 22, 2013 · 1 revision

Code Style

The Eventsourced code style follows the Scala Style Guide.

Process

  • Make sure you have signed the Eligotech CLA (print, sign, scan, email)
  • Pick a ticket, if there is no ticket for your work then create one first.
  • Start working in a feature branch. Name it something like wip-<ticket number>-<descriptive name>.
  • When you are done, create a pull request towards the targeted branch.
  • When there's consensus on the review, someone from the committers will merge it.

Commit messages

Please follow these guidelines when creating public commits and writing commit messages.

  1. If your work spans multiple local commits (for example, if you do safe point commits while working in a topic branch or work in a branch for long time doing merges/rebases etc.) then please do not commit it all but rewrite the history by squashing the commits into a single big commit which you write a good commit message for (like discussed below). Here is a great article for how to do that: http://sandofsky.com/blog/git-workflow.html. Every commit should be able to be used in isolation, cherry picked etc.
  2. First line should be a descriptive sentence what the commit is doing. It should be possible to fully understand what the commit does by just reading this single line. It is not ok to only list the ticket number, type "minor fix" or similar. Include reference to ticket number, prefixed with #, at the end of the first line. If the commit is a small fix, then you are done. If not, go to 3.
  3. Following the single line description should be a blank line followed by an enumerated list with the details of the commit.

Example:

Isolated write of counter per writer.

- Details 1
- Details 2
- Details 3
- Fixes #XXX (or Closes ###XXX if it's not a bug)

Testing

All code that is checked in should have tests. All testing is done with ScalaTest using WordSpec and MustMatchers.

File headers

Source files must contain the following header:

/*
 * Copyright 2012-2013 Eligotech BV.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
Clone this wiki locally