foodcritic 13.0.0 → 13.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/lib/foodcritic.rb +3 -0
- data/lib/foodcritic/api.rb +5 -1
- data/lib/foodcritic/linter.rb +5 -3
- data/lib/foodcritic/rules/fc085.rb +1 -1
- data/lib/foodcritic/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4043ba45f55c8b88b96eeb28ecb5111dd92e98ba45d1c74dc3ca86bc92c57cdc
|
4
|
+
data.tar.gz: 2f9bd70e42c3cbdec213e727c33b568d21ed72578dca8a173110f2944375d1e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d7d07e5748a0a19265b0d26d7347d07e90d79bd1aff1565c1c210501f1f29205e7d433cdeeea5646bdb2793e1517f78b76134639e2bab5add1433e161a65f2de
|
7
|
+
data.tar.gz: c17b5b064688c41d3a397202314df1938f549071dc07d1f368e730e5f795f73626d8e958524931bdf45b8d0523ce94f236c77814cd1196d5651f3d8edd3c5f85
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Foodcritic Changelog:
|
2
2
|
|
3
|
+
## [13.0.1](https://github.com/Foodcritic/foodcritic/tree/v13.0.1) (2018-04-11)
|
4
|
+
|
5
|
+
- Properly discover templates not in templates/default/. Templates in the root of the templates directory would be skipped previously
|
6
|
+
- Force encoding to UTF8 to prevent errors when encoding isn't set on the host
|
7
|
+
- Alert with the filename when an improperly encoded file is encountered instead of silently failing
|
8
|
+
- Removed the chef13 tag from FC085
|
9
|
+
|
3
10
|
## [13.0.0](https://github.com/Foodcritic/foodcritic/tree/v13.0.0) (2018-03-07)
|
4
11
|
|
5
12
|
### Chef 12 Support
|
data/lib/foodcritic.rb
CHANGED
data/lib/foodcritic/api.rb
CHANGED
@@ -557,7 +557,11 @@ module FoodCritic
|
|
557
557
|
else
|
558
558
|
File.read(file).encode("utf-8", "binary", :undef => :replace)
|
559
559
|
end
|
560
|
-
|
560
|
+
begin
|
561
|
+
build_xml(Ripper::SexpBuilder.new(source).parse)
|
562
|
+
rescue RuntimeError => e # this generally means bad encoding
|
563
|
+
raise "Could not parse the file at #{file}. #{e}"
|
564
|
+
end
|
561
565
|
end
|
562
566
|
|
563
567
|
# XPath custom function
|
data/lib/foodcritic/linter.rb
CHANGED
@@ -242,8 +242,10 @@ module FoodCritic
|
|
242
242
|
end
|
243
243
|
end
|
244
244
|
|
245
|
-
# Return the files within a cookbook tree that we are interested in trying
|
246
|
-
#
|
245
|
+
# Return the files within a cookbook tree that we are interested in trying to match rules against.
|
246
|
+
#
|
247
|
+
# @param [Hash] paths - paths of interest: {:exclude=>[], :cookbook=>[], :role=>[], :environment=>[]}
|
248
|
+
# @return [Array] array of hashes for each file {:filename=>"./metadata.rb", :path_type=>:cookbook}
|
247
249
|
def files_to_process(paths)
|
248
250
|
paths.reject { |type, _| type == :exclude }.map do |path_type, dirs|
|
249
251
|
dirs.map do |dir|
|
@@ -258,7 +260,7 @@ module FoodCritic
|
|
258
260
|
if File.directory?(dir)
|
259
261
|
glob = if path_type == :cookbook
|
260
262
|
"{metadata.rb,attributes.rb,recipe.rb,{attributes,definitions,libraries,"\
|
261
|
-
"providers,recipes,resources}/*.rb,templates
|
263
|
+
"providers,recipes,resources}/*.rb,templates/**/*.erb}"
|
262
264
|
else
|
263
265
|
"*.rb"
|
264
266
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
rule "FC085", "Resource using new_resource.updated_by_last_action to converge resource" do
|
2
|
-
tags %w{
|
2
|
+
tags %w{correctness}
|
3
3
|
def updated_by(ast)
|
4
4
|
# we need to handle both @new_resource.updated_by_last_action(true) or new_resource.updated_by_last_action(true)
|
5
5
|
# Here's the ast that xpath sees in all 3 possible scenarios from those two:
|
data/lib/foodcritic/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foodcritic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 13.0.
|
4
|
+
version: 13.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Crump
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cucumber-core
|
@@ -548,5 +548,5 @@ rubyforge_project:
|
|
548
548
|
rubygems_version: 2.7.5
|
549
549
|
signing_key:
|
550
550
|
specification_version: 4
|
551
|
-
summary: foodcritic-13.0.
|
551
|
+
summary: foodcritic-13.0.1
|
552
552
|
test_files: []
|