Class: Policial::StyleGuides::CoffeeScript

Inherits:
Base
  • Object
show all
Defined in:
lib/policial/style_guides/coffeescript.rb

Overview

Public: Determine CoffeeScript style guide violations per-line.

Constant Summary collapse

KEY =
:coffeescript

Instance Method Summary collapse

Methods inherited from Base

#config_file, #initialize, #investigate?

Constructor Details

This class inherits a constructor from Policial::StyleGuides::Base

Instance Method Details

#default_config_fileObject



24
25
26
# File 'lib/policial/style_guides/coffeescript.rb', line 24

def default_config_file
  'coffeelint.json'
end

#exclude_file?(_filename) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/policial/style_guides/coffeescript.rb', line 16

def exclude_file?(_filename)
  false
end

#filename_patternObject



20
21
22
# File 'lib/policial/style_guides/coffeescript.rb', line 20

def filename_pattern
  /.+\.coffee\z/
end

#violations_in_file(file) ⇒ Object



11
12
13
14
# File 'lib/policial/style_guides/coffeescript.rb', line 11

def violations_in_file(file)
  errors = Coffeelint.lint(file.content, config)
  violations(file, errors)
end