Class: Maximus::Scsslint

Inherits:
Lint
  • Object
show all
Defined in:
lib/maximus/lints/scsslint.rb

Overview

Since:

  • 0.1.0

Instance Attribute Summary

Attributes inherited from Lint

#output

Instance Method Summary collapse

Methods inherited from Lint

#initialize, #refine

Methods included from Helper

#check_default_config_path, #edit_yaml, #file_count, #file_list, #is_rails?, #lines_added_to_range, #node_module_exists, #path_exists, #prompt, #reporter_path, #root_dir, #truthy

Constructor Details

This class inherits a constructor from Maximus::Lint

Instance Method Details

#resultObject

SCSS-Lint

See Also:

Since:

  • 0.1.0


8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/maximus/lints/scsslint.rb', line 8

def result
  @task = 'scsslint'

  return unless temp_config(@task)
  @path = is_rails? ? "#{@settings[:root_dir]}/app/assets/stylesheets" : "#{@settings[:root_dir]}/source/assets/stylesheets" if @path.blank?

  return unless path_exists(@path)

  scss = `scss-lint #{@path} -c #{temp_config(@task)} --format=JSON`
  @output[:files_inspected] ||= files_inspected('scss')
  refine scss
end