Project

gl_lint

0.0
The project is in a healthy, maintained state
Give Lively linter tool
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

 Project Readme

Give Lively Lint runner

GLLint is a Ruby gem that handles running linters against specific files (e.g. just the changed files from a branch). It leverages git, rubocop and eslint

This is particularly useful for large projects where you don't want to lint all the files in the project.

At Give Lively, we add a file to bin/lint and have it call this gem to lint with autocorrect.

GLLint also adds a way to create a yaml file with all the currently configured rubocop rules (.rubocop_rules.yml). This is done via bin/lint --write-rubocop-rules. This file is useful to compare what changes when updating Rubocop rules, changing gems or Ruby versions.

Installation

Add this line to your application's Gemfile:

gem 'gl_lint', require: false

And then execute:

$ bundle install

Or install it yourself as:

$ gem install gl_lint

bin/lint

Create a an executable bin/lint file with:

touch bin/lint && chmod +x bin/lint

Then add this to the file:

#!/usr/bin/env ruby
require 'rubygems'
require 'gl_lint'

GLLint.call_cli(app_root: File.expand_path('..', __dir__))

Then run bin/lint to lint your changes.

Alternatively, if your project doesn't have JavaScript, add linters: ['rubocop']

GLLint.call_cli(app_root: File.expand_path('..', __dir__),
                linters: ['rubocop'])