pippi 0.0.2 → 0.0.3

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: c5a74d95bf3f5630ef99c31014f3bfcc83043cab
4
- data.tar.gz: d3225b55129c7c327fa963cec71a281c17f275c3
3
+ metadata.gz: 9f1712f4957c4dc681c64b2031b42668a1965c26
4
+ data.tar.gz: 2e7795a1a90750cb9838dcfa37e6a83a5ea9d5d3
5
5
  SHA512:
6
- metadata.gz: 367327d170a40465f8df9ff8bd41efb8c673068898dce752958557cf3cdc0c28f14f3fb8f4b0c8d2efe71ac18f321010f7f6814e679c4739010297daa7ab6fe1
7
- data.tar.gz: a2900f8d02ca4d99aed0f5180ba87489da2d9ca260434b7bd582d019eed30ec8f502f2c8c142a78f83d06da596d603057fc68425d768cd83530662cc442cd4e0
6
+ metadata.gz: d8c0198da71b5bc8ae6ce92d432374c74f97249394bfbe75c13862137d47d5864f0c8f7b43ed66084756a4677ac73f0c7dcd660df343455690330eeb5a52b5c1
7
+ data.tar.gz: 399fd31a5f4cb6938f2368b586902cfe7ded570ec00975d13c76eacdf90f2400a19c5f1d9afabc1efec1f6c1aa49b798a0cfa94bb874b2ded25d6e044325ab69
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ Oct 22, 2014 - 0.0.3:
2
+ Moved AssertWithNil to "buggy" checkset until I can figure out issues.
3
+
1
4
  Oct 22, 2014 - 0.0.2:
2
5
  Added AssertWithNil
3
6
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pippi (0.0.2)
4
+ pippi (0.0.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -2,6 +2,23 @@ Pippi is a utility for finding suboptimal Ruby class API usage.
2
2
 
3
3
  <a href="http://thomasleecopeland.com/2014/10/22/finding-suboptimal-api-usage.html">Here's a project overview</a>.
4
4
 
5
+ ## Checksets
6
+
7
+ Pippi has the concept of "checksets" which are, well, sets of checks. The current checksets are listed below.
8
+
9
+ Maybe we should have a dedicated "test" checkset? Let me know what you think at https://twitter.com/tcopeland, thanks!
10
+
11
+ ### Basic
12
+
13
+ * SelectFollowedByFirst
14
+ * SelectFollowedBySize
15
+ * ReverseFollowedByEach
16
+
17
+ ### Buggy
18
+
19
+ * AssertWithNil
20
+ * MapFollowedByFlatten
21
+
5
22
  ## Checks
6
23
 
7
24
  ### AssertWithNil
@@ -22,11 +22,11 @@ module Pippi
22
22
  "SelectFollowedByFirst",
23
23
  "SelectFollowedBySize",
24
24
  "ReverseFollowedByEach",
25
- "AssertWithNil"
26
25
  ],
27
26
  "training" => [
28
27
  ],
29
28
  "buggy" => [
29
+ "AssertWithNil",
30
30
  "MapFollowedByFlatten",
31
31
  ]
32
32
  }
data/lib/pippi/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Pippi
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -10,6 +10,26 @@ class AssertWithNilTest < CheckTest
10
10
  assert_no_problems "x = 42 ; assert_equal(42, x)", :include_rails_core_extensions => true, :subclass => "ActiveSupport::TestCase"
11
11
  end
12
12
 
13
+ # Seems like there's some way to do this, but maybe not... anyhow, moving this rule to "buggy" for now
14
+ # pippi> $ echo "foo(nil)" | ruby --dump insns
15
+ # == disasm: <RubyVM::InstructionSequence:<main>@->=======================
16
+ # 0000 trace 1 ( 1)
17
+ # 0002 putself
18
+ # 0003 putnil
19
+ # 0004 opt_send_simple <callinfo!mid:foo, argc:1, FCALL|ARGS_SKIP>
20
+ # 0006 leave
21
+ # pippi> $ echo "foo(x)" | ruby --dump insns
22
+ # == disasm: <RubyVM::InstructionSequence:<main>@->=======================
23
+ # 0000 trace 1 ( 1)
24
+ # 0002 putself
25
+ # 0003 putself
26
+ # 0004 opt_send_simple <callinfo!mid:x, argc:0, FCALL|VCALL|ARGS_SKIP>
27
+ # 0006 opt_send_simple <callinfo!mid:foo, argc:1, FCALL|ARGS_SKIP>
28
+ # 0008 leave
29
+ def test_nil_reference_first_arg_doesnt_flag
30
+ assert_no_problems "x = 42 ; y = nil ; assert_equal(nil, x)", :include_rails_core_extensions => true, :subclass => "ActiveSupport::TestCase"
31
+ end
32
+
13
33
  def test_three_arg_is_flagged
14
34
  assert_problems "x = 42 ; assert_equal(nil, x, 'whatevs')", :include_rails_core_extensions => true, :subclass => "ActiveSupport::TestCase"
15
35
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pippi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Copeland
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-22 00:00:00.000000000 Z
11
+ date: 2014-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake