Search code examples
rubysyntaxtabsspacerubocop

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...


Solution

  • I overrid 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...