foodcritic 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,22 +1,3 @@
1
- rule "FC001", "Use symbols in preference to strings to access node attributes" do
2
- description "When accessing node attributes you should use a symbol for a key rather than a string literal."
3
- recipe do |ast|
4
- matches = []
5
- attribute_refs = %w{node default override set normal}
6
- aref_fields = self.ast(:aref, ast) + self.ast(:aref_field, ast)
7
- aref_fields.each do |field|
8
- is_node_aref = attribute_refs.include? self.ast(:@ident, field).flatten.drop(1).first
9
- if is_node_aref
10
- literal_strings = self.ast(:@tstring_content, field)
11
- literal_strings.each do |str|
12
- matches << {:matched => str[1], :line => str[2].first, :column => str[2].last}
13
- end
14
- end
15
- end
16
- matches
17
- end
18
- end
19
-
20
1
  rule "FC002", "Avoid string interpolation where not required" do
21
2
  description "When setting a resource value avoid string interpolation where not required."
22
3
  recipe do |ast|
@@ -1,3 +1,3 @@
1
1
  module FoodCritic
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foodcritic
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2011-11-30 00:00:00.000000000 Z
12
+ date: 2011-12-01 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: Lint tool for Opscode Chef cookbooks.
15
15
  email:
@@ -18,13 +18,13 @@ executables:
18
18
  extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
+ - lib/foodcritic.rb
21
22
  - lib/foodcritic/domain.rb
22
- - lib/foodcritic/dsl.rb
23
- - lib/foodcritic/helpers.rb
24
23
  - lib/foodcritic/linter.rb
25
24
  - lib/foodcritic/rules.rb
25
+ - lib/foodcritic/helpers.rb
26
26
  - lib/foodcritic/version.rb
27
- - lib/foodcritic.rb
27
+ - lib/foodcritic/dsl.rb
28
28
  - bin/foodcritic
29
29
  homepage: http://acrmp.github.com/foodcritic
30
30
  licenses:
@@ -47,12 +47,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
47
47
  version: '0'
48
48
  segments:
49
49
  - 0
50
- hash: -3064369866529469522
50
+ hash: 1647657478747687717
51
51
  requirements: []
52
52
  rubyforge_project:
53
53
  rubygems_version: 1.8.10
54
54
  signing_key:
55
55
  specification_version: 3
56
- summary: foodcritic-0.1.0
56
+ summary: foodcritic-0.2.0
57
57
  test_files: []
58
58
  has_rdoc: