Skip to content

Latest commit

 

History

History
54 lines (39 loc) · 1.12 KB

specs_and_linting.md

File metadata and controls

54 lines (39 loc) · 1.12 KB

< Back to Navigation

Specs and Linting

  1. Running specs and linting
  2. Running specs
  3. Running linting with auto correct

The NPQ app users RSpec for testing and Rubocop for linting ruby code.

The linting rules we use are inherited from RuboCop GOV.UK to ensure consistency across GOV.UK services. These are enforced at the PR stage by Github Actions.

Running specs and linting

This will run rspec, rubocop, and scss-lint.

bundle exec rake

Running specs

To run just rspec:

bundle exec rspec

Running specs in parallel

One time Setup

bundle exec rake parallel:setup

Running specs thereafter

bundle exec rake parallel:spec

Running linting with auto correct

To safely autocorrect offenses run:

bundle exec rubocop -a

To autocorrect all offenses, safe and unsafe, run:

bundle exec rubocop -A

To lint the stylesheets run:

bundle exec scss-lint app/assets/stylesheets