rubomatic-html 1.0.0.pre.rc.7 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 92f8dc1b2822df41a944940b7920eee075b2106c5159ee6be1241d1e8bd441db
4
- data.tar.gz: 15e06bd14aad357a607312bfed62aa3c68a77bee0bec5690048b3872b5d18974
3
+ metadata.gz: 3b7c76016bb1d33526a70bf322a25f55569c3d93a50bf3795bd7d4ded5c99fd7
4
+ data.tar.gz: c7e5015c673fab3d8c42cbafc3b3355a660c0786d1a5775a1797d838fd2f324d
5
5
  SHA512:
6
- metadata.gz: 905843f469af82880378503aedc2d028b612f81f00ad889f5b2228410eb64864ff3a65908a958ca0a595bc281dce11bc289e94bdb58bc5f93623d40e8da6e073
7
- data.tar.gz: ecb82747e79df319c71d6c77311a041336f1ba9921732544b7c25853ad7dff0fb2d571d0f9a29c6609f6e769a0cd770d181da280a36125819aff6ea265e11a7d
6
+ metadata.gz: 305f5ad46e7711590c445f3b60edfa27960cfd985012b9929901c94b5137af2d1a9e70c173439420302dd29f3b72a1f3dddce3f8c8cbdbe02117bfaf6a0ed6ea
7
+ data.tar.gz: dd716790e59ac5c9fdca784ddddeb3d9231b6022862cd7ebd02887a5636a3646cf137521d7b6e509fdb58ce9e236fb605c4ff4f9bbb9f29b6f43107fb006e976
data/README.adoc CHANGED
@@ -35,13 +35,29 @@ Or
35
35
  bundle exec rubomatic-html
36
36
  ----
37
37
 
38
- To ignore specific files, create ``.rubomatic_html_ignore``
38
+ To ignore specific files, create ``.rubomatic-html.yml``
39
39
 
40
- [source,text]
40
+ [source,yaml]
41
41
  ----
42
- app/views/layouts/partials/_dropzone_preview_template.html.erb
43
- app/views/shared/_global_email.html.erb
44
- app/views/shared/_global_email_text.text.erb
42
+ AllCops:
43
+ Enabled: true
44
+ Exclude:
45
+ - app/views/layouts/partials/_dropzone_preview_template.html.erb
46
+ - app/views/shared/_global_email.html.erb
47
+ - app/views/shared/_global_email_text.text.erb
48
+
49
+ Layout/LineLength:
50
+ Enabled: true
51
+
52
+ Layout/MultipleLineBreaks:
53
+ Enabled: true
54
+
55
+ Layout/TrailingWhitespace:
56
+ Enabled: true
57
+
58
+ Style/PartialInstanceVariable:
59
+ Enabled: true
60
+
45
61
  ----
46
62
 
47
63
  == Departments
@@ -3,6 +3,9 @@
3
3
  module RubomaticHtml
4
4
  module Cop
5
5
  class Base
6
+ # @return [String]
7
+ attr_accessor :file
8
+
6
9
  # Name for cop
7
10
  #
8
11
  # @return [String]
@@ -11,9 +14,6 @@ module RubomaticHtml
11
14
  'Base'
12
15
  end
13
16
 
14
- # @return [String]
15
- attr_accessor :file
16
-
17
17
  # :nodoc:
18
18
  def initialize(file)
19
19
  @file = file
@@ -23,12 +23,17 @@ module RubomaticHtml
23
23
 
24
24
  # Outputs filename:line_number locations of HTML files that trigger the cop
25
25
  #
26
- # @param line [String] the line in the html
27
- # @param index [Integer] the 1-index of the line
26
+ # @param _line [String] the line in the html
27
+ # @param _index [Integer] the 1-index of the line
28
28
  #
29
29
  # @return [void]
30
30
  #
31
- def run_for_line(line, index)
31
+ def run_for_line(_line, _index)
32
+ error_message = <<~TEXT
33
+ Warning: Method `run_for_line` needs overridden! Some cops may not display failing messages.
34
+ TEXT
35
+
36
+ puts("\e[33m#{error_message}\e[0m")
32
37
  end
33
38
  end
34
39
  end
@@ -4,6 +4,9 @@ module RubomaticHtml
4
4
  module Cop
5
5
  module Layout
6
6
  class MultipleLineBreaks < RubomaticHtml::Cop::Layout::Base
7
+ # @return [Boolean] tracks multiple consecutive line breaks
8
+ attr_accessor :prev_break
9
+
7
10
  # Name for the cop
8
11
  #
9
12
  # @return [String]
@@ -12,9 +15,6 @@ module RubomaticHtml
12
15
  [department, 'MultipleLineBreaks'].join('/')
13
16
  end
14
17
 
15
- # @return [Boolean] tracks multiple consecutive line breaks
16
- attr_accessor :prev_break
17
-
18
18
  # :nodoc:
19
19
  def initialize(file)
20
20
  super
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubomaticHtml
4
- VERSION = '1.0.0-rc.7'
4
+ VERSION = '1.0.0'
5
5
  end
@@ -7,15 +7,15 @@ require 'yaml'
7
7
 
8
8
  module RubomaticHtml
9
9
  class Runner
10
+ PROJECT_ROOT = Pathname.new(__dir__).parent.expand_path.freeze
11
+ CONFIG_DEFAULT = PROJECT_ROOT.join('config', 'default.yml').freeze
12
+ CONFIG = ::YAML.safe_load(CONFIG_DEFAULT.read).freeze
13
+
10
14
  # @return [Array<String>]
11
15
  attr_accessor :files_to_lint
12
16
  # @return [Hash]
13
17
  attr_accessor :config
14
18
 
15
- PROJECT_ROOT = Pathname.new(__dir__).parent.expand_path.freeze
16
- CONFIG_DEFAULT = PROJECT_ROOT.join('config', 'default.yml').freeze
17
- CONFIG = ::YAML.safe_load(CONFIG_DEFAULT.read).freeze
18
-
19
19
  # @param linted_files [Array<String>]
20
20
  #
21
21
  def initialize(linted_files)
@@ -39,6 +39,7 @@ module RubomaticHtml
39
39
  if custom_config.fetch(cop, {}).has_key?('Enabled')
40
40
  config[cop][:enabled] = custom_config[cop]['Enabled']
41
41
  end
42
+
42
43
  if custom_config.fetch(cop, {}).has_key?('Exclude')
43
44
  config[cop][:exclude] = Array(custom_config[cop]['Exclude'])
44
45
  end
@@ -53,6 +54,7 @@ module RubomaticHtml
53
54
  #
54
55
  def run
55
56
  all_config = config.fetch('AllCops')
57
+
56
58
  files_to_lint.each do |file|
57
59
  next if all_config.fetch(:exclude).any? { |ignored| file.end_with?(ignored) }
58
60
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubomatic-html
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.rc.7
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brands Insurance
@@ -72,9 +72,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
72
72
  version: 3.0.1
73
73
  required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  requirements:
75
- - - ">"
75
+ - - ">="
76
76
  - !ruby/object:Gem::Version
77
- version: 1.3.1
77
+ version: '0'
78
78
  requirements: []
79
79
  rubygems_version: 3.2.15
80
80
  signing_key: