rubomatic-html 1.0.0.pre.rc.5 → 1.0.0.pre.rc.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/rubomatic-html +1 -0
- data/lib/rubomatic-html/cop/base.rb +8 -0
- data/lib/rubomatic-html/cop/cops.rb +2 -0
- data/lib/rubomatic-html/cop/layout/base.rb +17 -0
- data/lib/rubomatic-html/cop/layout/line_length.rb +9 -1
- data/lib/rubomatic-html/cop/layout/multiple_line_breaks.rb +9 -1
- data/lib/rubomatic-html/cop/layout/trailing_whitespace.rb +9 -1
- data/lib/rubomatic-html/cop/style/base.rb +17 -0
- data/lib/rubomatic-html/cop/style/partial_instance_variable.rb +9 -1
- data/lib/rubomatic-html/version.rb +1 -1
- data/lib/rubomatic-html.rb +4 -2
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92f8dc1b2822df41a944940b7920eee075b2106c5159ee6be1241d1e8bd441db
|
4
|
+
data.tar.gz: 15e06bd14aad357a607312bfed62aa3c68a77bee0bec5690048b3872b5d18974
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 905843f469af82880378503aedc2d028b612f81f00ad889f5b2228410eb64864ff3a65908a958ca0a595bc281dce11bc289e94bdb58bc5f93623d40e8da6e073
|
7
|
+
data.tar.gz: ecb82747e79df319c71d6c77311a041336f1ba9921732544b7c25853ad7dff0fb2d571d0f9a29c6609f6e769a0cd770d181da280a36125819aff6ea265e11a7d
|
data/exe/rubomatic-html
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative 'base'
|
4
|
+
require_relative 'layout/base'
|
4
5
|
require_relative 'layout/line_length'
|
5
6
|
require_relative 'layout/multiple_line_breaks'
|
6
7
|
require_relative 'layout/trailing_whitespace'
|
8
|
+
require_relative 'style/base'
|
7
9
|
require_relative 'style/partial_instance_variable'
|
@@ -3,7 +3,15 @@
|
|
3
3
|
module RubomaticHtml
|
4
4
|
module Cop
|
5
5
|
module Layout
|
6
|
-
class LineLength < RubomaticHtml::Cop::Base
|
6
|
+
class LineLength < RubomaticHtml::Cop::Layout::Base
|
7
|
+
# Name for the cop
|
8
|
+
#
|
9
|
+
# @return [String]
|
10
|
+
#
|
11
|
+
def self.name
|
12
|
+
[department, 'LineLength'].join('/')
|
13
|
+
end
|
14
|
+
|
7
15
|
# @see super
|
8
16
|
def run_for_line(line, index)
|
9
17
|
return if line.size <= 120
|
@@ -3,7 +3,15 @@
|
|
3
3
|
module RubomaticHtml
|
4
4
|
module Cop
|
5
5
|
module Layout
|
6
|
-
class MultipleLineBreaks < RubomaticHtml::Cop::Base
|
6
|
+
class MultipleLineBreaks < RubomaticHtml::Cop::Layout::Base
|
7
|
+
# Name for the cop
|
8
|
+
#
|
9
|
+
# @return [String]
|
10
|
+
#
|
11
|
+
def self.name
|
12
|
+
[department, 'MultipleLineBreaks'].join('/')
|
13
|
+
end
|
14
|
+
|
7
15
|
# @return [Boolean] tracks multiple consecutive line breaks
|
8
16
|
attr_accessor :prev_break
|
9
17
|
|
@@ -3,7 +3,15 @@
|
|
3
3
|
module RubomaticHtml
|
4
4
|
module Cop
|
5
5
|
module Layout
|
6
|
-
class TrailingWhitespace < RubomaticHtml::Cop::Base
|
6
|
+
class TrailingWhitespace < RubomaticHtml::Cop::Layout::Base
|
7
|
+
# Name for the cop
|
8
|
+
#
|
9
|
+
# @return [String]
|
10
|
+
#
|
11
|
+
def self.name
|
12
|
+
[department, 'TrailingWhitespace'].join('/')
|
13
|
+
end
|
14
|
+
|
7
15
|
# @see super
|
8
16
|
def run_for_line(line, index)
|
9
17
|
return unless line.match?(/\s\z/i)
|
@@ -3,7 +3,15 @@
|
|
3
3
|
module RubomaticHtml
|
4
4
|
module Cop
|
5
5
|
module Style
|
6
|
-
class PartialInstanceVariable < RubomaticHtml::Cop::Base
|
6
|
+
class PartialInstanceVariable < RubomaticHtml::Cop::Style::Base
|
7
|
+
# Name for the cop
|
8
|
+
#
|
9
|
+
# @return [String]
|
10
|
+
#
|
11
|
+
def self.name
|
12
|
+
[department, 'PartialInstanceVariable'].join('/')
|
13
|
+
end
|
14
|
+
|
7
15
|
# @see super
|
8
16
|
def run_for_line(line, index)
|
9
17
|
return unless File.basename(file).match?(/^_/i)
|
data/lib/rubomatic-html.rb
CHANGED
@@ -92,14 +92,16 @@ module RubomaticHtml
|
|
92
92
|
#
|
93
93
|
def run_file(file)
|
94
94
|
cops = all_cops.filter_map do |cop|
|
95
|
-
next unless config.dig(cop.
|
95
|
+
next unless config.dig(cop.name, :enabled)
|
96
96
|
|
97
97
|
cop.new(file)
|
98
98
|
end
|
99
99
|
|
100
|
+
return if cops.empty?
|
101
|
+
|
100
102
|
File.open(file).each_line(chomp: true).with_index(1) do |line, index|
|
101
103
|
cops.each do |cop|
|
102
|
-
next if config.dig(cop.
|
104
|
+
next if config.dig(cop.class.name).fetch(:exclude, []).any? { |ignored| file.end_with?(ignored) }
|
103
105
|
|
104
106
|
cop.run_for_line(line, index)
|
105
107
|
end
|
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.
|
4
|
+
version: 1.0.0.pre.rc.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brands Insurance
|
@@ -46,9 +46,11 @@ files:
|
|
46
46
|
- lib/rubomatic-html.rb
|
47
47
|
- lib/rubomatic-html/cop/base.rb
|
48
48
|
- lib/rubomatic-html/cop/cops.rb
|
49
|
+
- lib/rubomatic-html/cop/layout/base.rb
|
49
50
|
- lib/rubomatic-html/cop/layout/line_length.rb
|
50
51
|
- lib/rubomatic-html/cop/layout/multiple_line_breaks.rb
|
51
52
|
- lib/rubomatic-html/cop/layout/trailing_whitespace.rb
|
53
|
+
- lib/rubomatic-html/cop/style/base.rb
|
52
54
|
- lib/rubomatic-html/cop/style/partial_instance_variable.rb
|
53
55
|
- lib/rubomatic-html/version.rb
|
54
56
|
homepage: https://github.com/BrandsInsurance/expert-chainsaw/
|