Giter Club home page Giter Club logo

alphagov.govuk-lint's Introduction

DEPRECATED

This repository and Gem has been deprecated and is no longer supported.

To lint Ruby and RSpec projects please consider using rubocop with rubocop-govuk.

To lint SASS projects please consider using scss-lint with scss-lint-govuk.

For guidance on upgrading to these tools see the migrate from govuk-lint page in the developer docs.

GOV.UK Lint

This repo configures various linters to comply with our style guides.

Supported languages

Puppet

We maintain a set of tasks for linting and sanity checks in the gds-operations/puppet-syntax repository.

Ruby

Linter: rubocop

To use, include govuk-lint in your Gemfile and run:

bundle exec govuk-lint-ruby <files and directories>

It's best to lint just your app directories and not those belonging to the framework, e.g.

bundle exec govuk-lint-ruby app lib spec

Useful options:

  • -a: Auto-correct violations if possible
  • -R: Also run Rails-specific cops
  • --diff: Only lint lines that have been changed in the current diff
  • --cached: Used with --diff to lint only lines changed between origin/master and HEAD.

See more options in the rubocop README.

RSpec

You can enable RSpec cops by adding the following line to the .rubocop.yml file in your project:

require: rubocop-rspec

Sass

Linter: scss-lint

To use, include govuk-lint in your Gemfile and run:

bundle exec govuk-lint-sass <directory or file>
bundle exec govuk-lint-sass app/assets/stylesheets

When linting your app any assets within vendor will be ignored by default.

Auto-correction and --diff mode are unavailable.

alphagov.govuk-lint's People

Contributors

boffbowsh avatar tijmenb avatar floehopper avatar fofr avatar benlovell avatar h-lame avatar benthorner avatar theseanything avatar edwardkerry avatar kevindew avatar alext avatar erkde avatar cbaines avatar emmabeynon avatar elliotcm avatar issyl0 avatar 36degrees avatar jackscotti avatar chrisbashton avatar klssmith avatar jamiecobbett avatar gidsg avatar davidslv avatar suzannehamilton avatar thomasleese avatar rubenarakelyan avatar nickcolley avatar barrucadu avatar mattbostock avatar gpeng avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.