rubomatic-html 0.1.0 → 0.2.0
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 +3 -0
- data/lib/rubomatic-html/cop/base.rb +32 -0
- data/lib/rubomatic-html/cop/layout/line_length.rb +16 -0
- data/lib/rubomatic-html/cop/layout/trailing_whitespace.rb +16 -0
- data/lib/rubomatic-html/cop/style/partial_instance_variable.rb +17 -0
- data/lib/rubomatic-html/version.rb +1 -1
- metadata +9 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2feb228bfcfe89977098ed0bcbd954f01d5c98d5463efef59a1d68b100b5562
|
4
|
+
data.tar.gz: 49d1172eeadffa303d8638050429a5c2ae8c39e4844df5a5ae390c91efb11785
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e606e10f3f7d0b03cb07eaac70f1c74af5c211a96b0b8e4ef5f5456513cf851e32cb6ba1f9dc21e35867d6884b1126cd8efc4406862f38473887494a6c5f0d92
|
7
|
+
data.tar.gz: 1934e0c133299678113e12cd919b2513fb62f659bb0f26a944072b6c4641448a2df48327fec1ba090ee267ed65b9459b366d94d5390e6459afb28e476b4b372d
|
data/exe/rubomatic-html
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RubomaticHtml
|
4
|
+
module Cop
|
5
|
+
class Base
|
6
|
+
# @return [String]
|
7
|
+
attr_accessor :file
|
8
|
+
# @return [String]
|
9
|
+
attr_accessor :line
|
10
|
+
# @return [Integer]
|
11
|
+
attr_accessor :index
|
12
|
+
|
13
|
+
# :nodoc:
|
14
|
+
def initialize(file, line, index)
|
15
|
+
@file = file
|
16
|
+
@line = line
|
17
|
+
@index = index
|
18
|
+
|
19
|
+
check_line
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
# Outputs filename:line_number locations of HTML files that trigger the cop
|
25
|
+
#
|
26
|
+
# @return [void]
|
27
|
+
#
|
28
|
+
def check_line
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RubomaticHtml
|
4
|
+
module Cop
|
5
|
+
module Layout
|
6
|
+
class LineLength < RubomaticHtml::Cop::Base
|
7
|
+
# @see super
|
8
|
+
def check_line
|
9
|
+
return if line.size <= 120
|
10
|
+
|
11
|
+
puts("#{file}:#{index}: is over 120 characters")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RubomaticHtml
|
4
|
+
module Cop
|
5
|
+
module Layout
|
6
|
+
class TrailingWhitespace < RubomaticHtml::Cop::Base
|
7
|
+
# @see super
|
8
|
+
def check_line
|
9
|
+
return unless line.match?(/\s\z/i)
|
10
|
+
|
11
|
+
puts("#{file}:#{index}: has trailing whitespace")
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RubomaticHtml
|
4
|
+
module Cop
|
5
|
+
module Style
|
6
|
+
class PartialInstanceVariable < RubomaticHtml::Cop::Base
|
7
|
+
# @see super
|
8
|
+
def check_line
|
9
|
+
return unless File.basename(file).match?(/^_/i)
|
10
|
+
return unless line.match?(/@/i)
|
11
|
+
|
12
|
+
puts("#{file}:#{index}: might use an instance variable")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
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: 0.
|
4
|
+
version: 0.2.0
|
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-05-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubomatic
|
@@ -41,13 +41,19 @@ dependencies:
|
|
41
41
|
description:
|
42
42
|
email:
|
43
43
|
- documents@brandsinsurance.com
|
44
|
-
executables:
|
44
|
+
executables:
|
45
|
+
- rubomatic-html
|
45
46
|
extensions: []
|
46
47
|
extra_rdoc_files: []
|
47
48
|
files:
|
48
49
|
- CHANGELOG.adoc
|
49
50
|
- LICENSE.txt
|
50
51
|
- README.adoc
|
52
|
+
- exe/rubomatic-html
|
53
|
+
- lib/rubomatic-html/cop/base.rb
|
54
|
+
- lib/rubomatic-html/cop/layout/line_length.rb
|
55
|
+
- lib/rubomatic-html/cop/layout/trailing_whitespace.rb
|
56
|
+
- lib/rubomatic-html/cop/style/partial_instance_variable.rb
|
51
57
|
- lib/rubomatic-html/version.rb
|
52
58
|
- lib/rubomatic_html.rb
|
53
59
|
homepage: https://github.com/BrandsInsurance/expert-chainsaw/
|