Lint is a tool that analyzes source code to flag programming errors, bugs, stylistic errors, and suspicious constructs. So we don't need to spend time for code syntax checking, linters can do it for us.
Rubocop is a Ruby static code analyzer and formatter, based on the Ruby community style guide.
RuboCop is extremely flexible and most aspects of its behavior can be tweaked via various configuration options.
gem install rubocop
If you'd rather install RuboCop using bundler, don't require it in your Gemfile:
gem 'rubocop', require: false
ES-lint is a fully pluggable tool for identifying and reporting on patterns in JavaScript
If you want to include ESLint as part of your project's build system, we recommend installing it locally. You can do so using npm:
npm install eslint --save-dev
You should then set up a configuration file:
$ ./node_modules/.bin/eslint --init
After that, you can run ESLint on any file or directory like this:
./node_modules/.bin/eslint yourfile.js
SCSS-lint is a configurable tool for writing clean and consistent SCSS
Add to your Gemfile:
gem 'scss_lint'
After that, you can run SCSS-lint on any file or directory like this:
scss-lint app/assets/stylesheets/
or
scss-lint app/assets/stylesheets/**/*.css.scss
Slim-lint is a configurable tool for analyzing Slim templates
Add to your Gemfile:
gem 'slim_lint'
Run slim-lint from the command line by passing in a directory (or multiple directories) to recursively scan:
slim-lint app/views/
Overcommit is a fully configurable and extendable Git hook manager.
Overcommit is installed via RubyGems. It is strongly recommended that your environment supports running gem install without requiring sudo privileges. Using a Ruby version manager like rbenv or rvm can help here.
gem install overcommit
You can then run the overcommit command to install hooks into repositories.
mkdir important-project
cd important-project
git init
overcommit --install
Copyright © 2015-2019 Codica. It is released under the MIT License.
We love open source software! See our other projects or hire us to design, develop, and grow your product.