Code Monkey home page Code Monkey logo

clean-code-tools's Introduction

Linters configuration

Why we use linters?

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.

Linters libraries

Rubocop

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.

Installation

gem install rubocop

If you'd rather install RuboCop using bundler, don't require it in your Gemfile:

gem 'rubocop', require: false

Rubocop config example

Es Lint

ES-lint is a fully pluggable tool for identifying and reporting on patterns in JavaScript

Installation

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

SCSS-lint is a configurable tool for writing clean and consistent SCSS

Installation

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

SCSS-lint config example

Slim-lint

Slim-lint is a configurable tool for analyzing Slim templates

Installation

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/

Slim-lint config example

Overcommit

Overcommit is a fully configurable and extendable Git hook manager.

Installation

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

Overcommit config example

License

Copyright © 2015-2019 Codica. It is released under the MIT License.

About Codica

Codica logo

We love open source software! See our other projects or hire us to design, develop, and grow your product.

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.