rubomatic-html 1.0.0.pre.rc.8 → 1.0.1.pre.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.adoc +6 -1
- data/exe/rubomatic-html +0 -1
- data/lib/rubomatic-html/cop/base.rb +6 -6
- data/lib/rubomatic-html/cop/layout/multiple_line_breaks.rb +3 -3
- data/lib/rubomatic-html/version.rb +1 -1
- data/lib/rubomatic-html.rb +6 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fb7cf9832644d569f8e6f7e2f2a5b176e6be12faf0834826752aa8910e89581
|
4
|
+
data.tar.gz: 6f0cfea1ca1f904a7960e93c10ad3859697ac78fdc36ab07d449c7860e9ed119
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 464b0f1b8c525e1aa8ddd34adf41f260bbfbca19fb8826329f9baf2949f7ae8925eca8c6e95dee2d48a6a306048bbe7bb989940a38da24978057bbe54ec3d2cb
|
7
|
+
data.tar.gz: 2de234355f0923c9c9b85081ea2d03bf8be2540626c752ed3c9bf3268c346cfc0534a0ca608e8ae4a1408d7c6c52c9a201de43b2bdde3d94ddb16c26e07b3a27
|
data/CHANGELOG.adoc
CHANGED
data/exe/rubomatic-html
CHANGED
@@ -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,12 @@ module RubomaticHtml
|
|
23
23
|
|
24
24
|
# Outputs filename:line_number locations of HTML files that trigger the cop
|
25
25
|
#
|
26
|
-
# @param
|
27
|
-
# @param
|
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(
|
31
|
+
def run_for_line(_line, _index)
|
32
32
|
error_message = <<~TEXT
|
33
33
|
Warning: Method `run_for_line` needs overridden! Some cops may not display failing messages.
|
34
34
|
TEXT
|
@@ -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
|
data/lib/rubomatic-html.rb
CHANGED
@@ -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,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubomatic-html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1.pre.rc.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brands Insurance
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05
|
11
|
+
date: 2023-06-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubomatic
|