Project

linters

0.0
No release in over a year
Check of ruby applications using rubocop, reek, brakeman, fasterer, bundle_audit and the other custom linters
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 11.0
~> 0.5
~> 5.4
~> 3.0
~> 0.71

Runtime

>= 0
 Project Readme

Linters

Linters is a tool which checks ruby applications using different code's analyzers. Default available analyzers are:

  • rubocop
  • reek
  • brakeman
  • bundle-audit
  • fasterer

Installation

  • Using RubyGems:

    gem install linters

    Install the linters which you want to use:

    gem install rubocop reek and etc...

  • Using Bundler:

    group :development do
      gem 'linters'
    end

    Add linters which you want to use:

      group :development do
        gem 'rubocop'
        gem 'reek'
        and etc...
      end

And then execute:

$ bundle

Usage

Configuration

Settings with default values:

  Linters.configure do |config|
    config.custom_linters = {}
    config.linters = %i[rubocop reek bundle_audit fasterer]
    config.settings_path = 'config/linter_settings.yml'
  end

Default config/linter_settings.yml:

linters:
  checkers:
    - rubocop
    - reek
    - bundle_audit
    - fasterer
  rubocop:
    warnings_number: 0
  reek:
    warnings_number: 0
  bundle_audit:
    warnings_number: 0
  fasterer:
    warnings_number: 0

If settings is absent that warnings_number equal zero.

Adding a customer linter

  Linters.configure do |config|
    config.custom_linters = {
      name: {
        command: 'execute command',
        parse_output: lambda { |output| 'parse output of the command for getting quantity of warnings' }
      }
    }
  end

Rewrite an available linter

  Linters.configure do |config|
    config.custom_linters = {
      rubocop: {
        command: 'your command',
        parse_output: lambda { |output| 'your parsing output' }
      }
    }
  end

Run a check

  • Run all linters
  rake linters:run_all
  • Run a specific linter
  rake linters:run[name of linter]

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/skrinits/linters.

License

The gem is available as open source under the terms of the MIT License.