stylr 0.0.14 → 0.0.15

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b46b97f10222c83aae520b8c1d91ca2385770241
4
- data.tar.gz: f27f477e52eea0efb2d9d8a4a8f8186c6cd9b388
3
+ metadata.gz: c38522363f3e8964f9c37bcd3fe9f12fa6838111
4
+ data.tar.gz: c267f67af3f5d65d703bb7cdcbc21e8bbc9c30a3
5
5
  SHA512:
6
- metadata.gz: aebf27289b35eb6841a27f1014ed901310adb1bbb7ef8cdd997b31f22883c911029c427a97cf6b1196af1c409f0176eb078923b502f862226e39a48afd467fdc
7
- data.tar.gz: 0e8044fa0a5e26be038c74bac517faec4a4b873fb8ffe7a53c982e018e0425675672a23a1956469cb50fb2f819d0d4aaa15c002550d62bc28aba65fe406a875d
6
+ metadata.gz: ceb8c4938d076cb1c5d1eb9f0204a6a78a611b1f9b26fe0b60f337f27a75ee28109f8bd66f1d281f26ff3b5bd7bdccf8423b0328e3e3f7721f6bea95772d789f
7
+ data.tar.gz: 7155e7cb3db60f1d1d3a846e1a17c0112a6a3edb9693b87c9e401cd69e6f7252b6655f1cb9a4f3a3cad8aeeab077d6750cfc49c836167626c02dc561f642af87
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- stylr (0.0.14)
4
+ stylr (0.0.15)
5
5
  main (~> 5.2, >= 5.2.0)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -21,6 +21,8 @@ Kind of raw still. Currently supports checking against the following:
21
21
  * Using tab characters instead of soft tabs
22
22
  * Spacing around math operators (<code>+</code>, <code>*</code>, etc)
23
23
  * Use of <code>===</code> (instead of <code>is_a?</code> or <code>kind_of?</code>)
24
+ * Spacing after the negation (<code>!</code>) operator
25
+ * Nesting of (one-line) ternary expressions
24
26
 
25
27
  Optionally checks for some metaprogramming, which you might not want in a large, enterprise codebase with varied levels of skill on your development team. This is not a condemnation of these practices - most of them are good, idiomatic Ruby. You might not, however, want your junior developers checking in lots of metaprogrammed code. Pass the '--meta' flag to enable these checks.
26
28
 
@@ -90,7 +90,7 @@ class Lint
90
90
  /[^\s]\+/ => :no_operator_spaces,
91
91
  /\+[^\s=]/ => :no_operator_spaces,
92
92
  /[^\s]-/ => :no_operator_spaces,
93
- /![^\S\n]/ => :space_after_bang,
93
+ /![^\S\n][^do\s]/ => :space_after_bang,
94
94
  /\s\?\s.*\s\?\s/ => :nested_ternary
95
95
  }.delete_if { |_, v| !@config[v.to_s] }
96
96
 
@@ -1,3 +1,3 @@
1
1
  module Stylr
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
@@ -109,6 +109,10 @@ module Stylr
109
109
  it "line ending with ! is fine" do
110
110
  l.violation?("shitty_rails_object.save!").should be_false
111
111
  end
112
+
113
+ it "bang methods followed by a block is not an error" do
114
+ l.violation?("things.reject! do |foo|").should be_false
115
+ end
112
116
  end
113
117
 
114
118
  context "nested ternaries" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stylr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Billie