diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2018-06-26 15:44:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-26 15:44:05 -0700 |
commit | 63bcddf146e84b2f93b32faeac19c9c8045d8250 (patch) | |
tree | 370cb4da1062dbd7710deda685cb5e47f5de1595 | |
parent | ee572136a5979bdb12d6e603a777db75458d0834 (diff) | |
parent | 7eddc0953612bba57d93b85f3957f66ca774b180 (diff) | |
download | ffi-yajl-63bcddf146e84b2f93b32faeac19c9c8045d8250.tar.gz |
Merge pull request #95 from chef/lcg/chefstyle
fix some chefstyle
-rw-r--r-- | .rubocop.yml | 4 | ||||
-rw-r--r-- | lib/ffi_yajl/benchmark/parse_stream.rb | 4 | ||||
-rw-r--r-- | lib/ffi_yajl/ffi/parser.rb | 4 |
3 files changed, 8 insertions, 4 deletions
diff --git a/.rubocop.yml b/.rubocop.yml index 1ed8c28..f48c3e6 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,7 @@ Lint/DuplicateMethods: Exclude: - 'lib/ffi_yajl/ffi/encoder.rb' +Style/HashSyntax: + Enabled: true +Security/Eval: + Enabled: false diff --git a/lib/ffi_yajl/benchmark/parse_stream.rb b/lib/ffi_yajl/benchmark/parse_stream.rb index 9ca0050..7fbbb9e 100644 --- a/lib/ffi_yajl/benchmark/parse_stream.rb +++ b/lib/ffi_yajl/benchmark/parse_stream.rb @@ -33,7 +33,7 @@ Benchmark.bmbm do |x| puts "JSON.parse" times.times do json.rewind - while chunk = json.gets + while ( chunk = json.gets ) JSON.parse(chunk, max_nesting: false) end end @@ -44,7 +44,7 @@ Benchmark.bmbm do |x| puts "ActiveSupport::JSON.decode" times.times do json.rewind - while chunk = json.gets + while ( chunk = json.gets ) ActiveSupport::JSON.decode(chunk) end end diff --git a/lib/ffi_yajl/ffi/parser.rb b/lib/ffi_yajl/ffi/parser.rb index 7c98d59..fa9d599 100644 --- a/lib/ffi_yajl/ffi/parser.rb +++ b/lib/ffi_yajl/ffi/parser.rb @@ -1,5 +1,5 @@ # Copyright (c) 2015 Lamont Granquist -# Copyright (c) 2015 Chef Software, Inc. +# Copyright (c) 2015-2018, Chef Software Inc. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -23,7 +23,7 @@ module FFI_Yajl module FFI module Parser - def set_value(val) # rubocop:disable Style/AccessorMethodName + def set_value(val) # rubocop:disable Naming/AccessorMethodName case stack.last when Hash raise FFI_Yajl::ParseError, "internal error: missing key in parse" if key.nil? |