Code Climate

Code Climate

Code Climate is a service that incorporates fully-configurable test coverage and maintainability data throughout the development workflow, making quality improvement explicit, continuous, and ubiquitous.

We use Code Climate for quality metrics and code coverage.

Quality Metrics

To setup quality metrics (static analysis), the following steps are executed.

  • We add the .codeclimate.yml file to the repository. This file defines the tools used for the analysis.
  • In Code Climate, we add the project.

Code Coverage

To setup code coverage, the following steps are executed.

  • We add the simplecovgem to the test and ci group.
  • We require simplecov for the ci environment. We keep the gem in the test group so we can run code coverage locally if needed.
  • We load the reporter ID (CC_TEST_REPORTER_ID) via environment variables to the CI environment.
  • We install the Code Climate reporter to the Docker image we use to run our CI.
  • We add Code Climate commands before and after running the specification suite.