Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rubocop for tabs

We would like to use Rubocop to validate our ruby is syntaxicaly correct and follow basic code guidelines.

Appart from that we have this rule : we indent using tabs to allow anybody to decided how they want them to be rendered (display them like 2 or 4 spaces)

The problem is that rubocop seems designed to refuse tabs for indentation AT ALL.

How can we override all theses rules to be space complients ?

EDIT: I'm thinking of overriding this module https://github.com/bbatsov/rubocop/blob/master/lib/rubocop/source_parser.rb to replace all tabs from my files by 2 spaces to create the illusion for the gem...

like image 745
user2854544 Avatar asked Jun 04 '14 19:06

user2854544


1 Answers

Add to your .rubocop.yml:

Style/Tab:
  Enabled: false

to disable the tabs rule.

You can write your own custom cop to check proper indentation.

like image 176
Uri Agassi Avatar answered Sep 29 '22 07:09

Uri Agassi