Skip to content

This is utility for getting easy and simple code quality report based on different linters, like rubocop or reek.

License

Notifications You must be signed in to change notification settings

artemasmith/supercop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Supercop

Build Status

This gem allows you to combine multiple linters with their configs in one place and run all checks by one command with tabled-view summary report (see below). You should specify which linters you would like to use, for example rubocop, reek, scss_linter etc. Gem would load them if they are not installed and run checks.

One gem for rule them all:)

Versions

It works for 2.2.3, 2.3.1, 2.3.3 versions of Ruby MRI.

Installation

Add this line to your application's Gemfile:

gem 'supercop'

And then execute:

$ bundle

Or install it yourself as:

$ gem install supercop

Install into another gem

Add supercop tasks to the Rakefile:

  spec = Gem::Specification.find_by_name 'supercop'
  load "#{spec.gem_dir}/lib/tasks/manage_settings.rake"
  load "#{spec.gem_dir}/lib/tasks/check.rake"

Usage

After install, you should modify supercop.yml and specify prefered linters. After that run

$ rake supercop:generate_config

for non-rails project (like gem) or

$ rails g supercop:config

for rails project

After that, please modify your supercop.yml config file, adding linters you want to use and run

$ rake supercop:load_dependencies

or you can do it manually by adding gems to your Gemfile (for other gems - to the end of file) and running bundle install.

Note: You should do it once.

Now you can run checks.

Clean up

If you want to restore all affected files and clean up supercop remnants, please run

$ rake supercop:cleanup

This will delete config file and erase changes made by Supercop to your Gemfile and bundle.

Running check

$ rake supercop:check
linter alerts max status
rubocop 48 99 ok
reek 45 99 ok
slim_lint none 99 ok
scss_lint none 99 ok

'none' - means linter did not work correctly. To figured out why - change 'verbose' option to true

Development

After checking out the repo, run bundle install and make your changes. After commit, create Pull Request and notify me.

Contributing

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

License

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

About

This is utility for getting easy and simple code quality report based on different linters, like rubocop or reek.

Resources

License

Stars

Watchers

Forks

Packages