0.0
No release in over a year
RuboCop plugin for Haml template.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 0.5
~> 1.45
 Project Readme

rubocop-haml

RuboCop plugin for Haml template.

Installation

Install the gem and add to the application's Gemfile by executing:

bundle add rubocop-haml

If bundler is not being used to manage dependencies, install the gem by executing:

gem install rubocop-haml

Usage

Require rubocop-haml in your RuboCop config.

# .rubocop.yml
require:
  - rubocop-haml

Now you can use RuboCop also for Haml templates.

$ bundle exec rubocop spec/fixtures/dummy.haml
Inspecting 1 file
C

Offenses:

spec/fixtures/dummy.haml:1:13: C: [Correctable] Style/CharacterLiteral: Do not use the character literal - use string literal instead.
%div(a="b #{?c}")
            ^^
spec/fixtures/dummy.haml:2:7: C: [Correctable] Style/HashSyntax: Use the new Ruby 1.9 hash syntax.
%div{ :a => "b" }
      ^^^^^
spec/fixtures/dummy.haml:2:13: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
%div{ :a => "b" }
            ^^^

1 file inspected, 3 offenses detected, 3 offenses autocorrectable

Related projects