stylr 0.0.12 → 0.0.13
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/Gemfile.lock +1 -1
- data/LICENSE.txt +1 -1
- data/README.md +1 -1
- data/lib/stylr/lint.rb +5 -1
- data/lib/stylr/version.rb +1 -1
- data/spec/lint_spec.rb +8 -0
- data/stylr.yml +2 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b6c5c561144b3451f609f05fa568125170b5e10
|
4
|
+
data.tar.gz: f6ddc8e22a2febd98984ebefef01a730edbd1368
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5ea60e64c2ee010d37e88af1e12243025e878f165826a810a208252412afcba9b9b57a771a50fee8a0c61b3742cf52db7575be242dd95e3f86d3a06751fae1d
|
7
|
+
data.tar.gz: 8a86db0eed7d016c89e7d846f9a582348b7fe408e82b5c2be08b9c3554b50bda8a365caa4ba18339cec243a722426cc5c63d5e3be874645df3e647933eb4d5fd
|
data/Gemfile.lock
CHANGED
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
[](https://gemnasium.com/yaaase/stylr)
|
5
5
|
<img src="https://badge.fury.io/rb/stylr.png"/>
|
6
6
|
|
7
|
-
This gem will check if source code conforms to some elements of the Github Ruby Style Guidelines (https://github.com/styleguide/ruby) - currently supporting Ruby 2.1.0 (
|
7
|
+
This gem will check if source code conforms to some elements of the Github Ruby Style Guidelines (https://github.com/styleguide/ruby) - currently supporting Ruby 2.1.0, but should support 1.9.3 and up (stylr uses the Ripper found in 1.9.3+; in 1.8.7, Ripper has been backported [here](https://github.com/lsegal/ripper18)). Obviously it does not check against the subjective elements of the styleguide.
|
8
8
|
|
9
9
|
Kind of raw still. Currently supports checking against the following:
|
10
10
|
|
data/lib/stylr/lint.rb
CHANGED
@@ -102,7 +102,9 @@ class Lint
|
|
102
102
|
/\bmodule_eval\b/ => :used_module_eval,
|
103
103
|
/\binstance_eval\b/ => :used_instance_eval,
|
104
104
|
/\bdefine_method\b/ => :used_define_method,
|
105
|
-
/\w+\.send.*".*#\{/ => :dynamic_invocation
|
105
|
+
/\w+\.send.*".*#\{/ => :dynamic_invocation,
|
106
|
+
/def\s+method_missing/ => :used_method_missing,
|
107
|
+
/def\s+respond_to_missing\?/ => :used_respond_to_missing
|
106
108
|
}.delete_if { |_, v| !@config[v.to_s] }
|
107
109
|
|
108
110
|
@commented_line = [
|
@@ -124,6 +126,8 @@ class Lint
|
|
124
126
|
:used_class_eval => "Used class_eval.",
|
125
127
|
:used_module_eval => "Used module_eval.",
|
126
128
|
:used_instance_eval => "Used instance_eval.",
|
129
|
+
:used_method_missing => "Please do not override method_missing.",
|
130
|
+
:used_respond_to_missing => "Please do not use respond_to_missing?.",
|
127
131
|
:paren_spacing => "Space after ( or before ).",
|
128
132
|
:bracket_spacing => "Space after [ or before ].",
|
129
133
|
:brace_spacing => "No space around { or before }.",
|
data/lib/stylr/version.rb
CHANGED
data/spec/lint_spec.rb
CHANGED
@@ -270,6 +270,14 @@ module Stylr
|
|
270
270
|
it "and even instance eval!" do
|
271
271
|
l.meta_violation?("instance_eval &block").should be_true
|
272
272
|
end
|
273
|
+
|
274
|
+
it "checks for method_missing of course" do
|
275
|
+
l.meta_violation?("def method_missing").should be_true
|
276
|
+
end
|
277
|
+
|
278
|
+
it "also checks for respond_to_missing" do
|
279
|
+
l.meta_violation?("def respond_to_missing?").should be_true
|
280
|
+
end
|
273
281
|
end
|
274
282
|
|
275
283
|
context "#exception_violation?" do
|
data/stylr.yml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stylr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mark Billie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: main
|
@@ -133,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
133
133
|
version: '0'
|
134
134
|
requirements: []
|
135
135
|
rubyforge_project:
|
136
|
-
rubygems_version: 2.2.
|
136
|
+
rubygems_version: 2.2.1
|
137
137
|
signing_key:
|
138
138
|
specification_version: 4
|
139
139
|
summary: stylr - enforcing Ruby coding style standards
|