Giter Club home page Giter Club logo

supercop's Introduction

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.

supercop's People

Contributors

artemasmith avatar

Stargazers

Maxim Larionov avatar  avatar Yurii Ustiushenko avatar Mike Andrianov avatar Vladimir Fedorov avatar Marat Khusnetdinov avatar

supercop's Issues

Make configuration generator

It's need to add config generator for rails and other gems with common settings.
Main settings are cops linters and their settings.

fix config generation

not copy, but create config file (it wouldn't work for other gems because path is current project directory)

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.