Teacher Training Entitlement - specs_and_linting
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