suspiciouss 0.1.3 → 0.1.4
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 +4 -4
- data/lib/suspiciouss/linter.rb +6 -1
- data/lib/suspiciouss/version.rb +1 -1
- data/spec/fixtures/changeset.diff +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 567136a373e6fc737a3440dcc0bc3573be561862
|
4
|
+
data.tar.gz: 9c2eb9b277b01fe03a902cd0365a782f4efeb18c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4311e6dbb1b38a071df9d29382bab7939e3b21a228ba6d998b1821a074a9f29f2bc1428f20495bd75923612f7d7aed09905c5eae0f1734479e22d6b1c54e72f6
|
7
|
+
data.tar.gz: 34a1c35da29158673df0e1e8bb87e18efd4125e351482952e50479f3ac656f2b16cb63acc30e08c963837f63a1c4cfd4c732da8f52a06bb4b3c8882f96d39fd7
|
data/lib/suspiciouss/linter.rb
CHANGED
@@ -59,7 +59,7 @@ module Suspiciouss
|
|
59
59
|
# Parses a line with each of the known suggestions and adds the result
|
60
60
|
# to the final output.
|
61
61
|
def parse(full_line)
|
62
|
-
line = strip_diff_syntax
|
62
|
+
line = strip_diff_syntax(remove_line_comments(full_line))
|
63
63
|
|
64
64
|
return unless full_line =~ /^\+ /
|
65
65
|
|
@@ -80,6 +80,11 @@ module Suspiciouss
|
|
80
80
|
line[2..-1]
|
81
81
|
end
|
82
82
|
|
83
|
+
# Returns a line without comments
|
84
|
+
def remove_line_comments(line)
|
85
|
+
line.gsub /\/\/.*$/, ''
|
86
|
+
end
|
87
|
+
|
83
88
|
def known_suggestions
|
84
89
|
@known_suggestions ||= suggestions_to_use.map do |suggestion_class|
|
85
90
|
SUGGESTIONS.const_get(suggestion_class).new
|
data/lib/suspiciouss/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: suspiciouss
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Cruz Horts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-08-
|
11
|
+
date: 2014-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|