Skip to content

Commit

Permalink
🔧 Update vulnerable gems (#2)
Browse files Browse the repository at this point in the history
* 🔧 Update vulnerable gems
  • Loading branch information
hirakiuc authored Feb 21, 2018
1 parent 85a30bf commit 62eca2d
Show file tree
Hide file tree
Showing 10 changed files with 306 additions and 52 deletions.
239 changes: 239 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,239 @@
Rails:
Enabled: false

AllCops:
Include:
- 'lib/**/*.rb'
Exclude:
- 'bin/*'
- '.bundle/**/*'
- 'spec/**/*.rb'

# Pending
Style/HashSyntax:
Description: >-
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
{ :a => 1, :b => 2 }.
Enabled: true
EnforcedStyle: ruby19
SupportedStyles:
- ruby19
- hash_rockets

# Modified
Metrics/LineLength:
Description: 'Limit lines to 80 characters.'
Enabled: true
Max: 100

Metrics/AbcSize:
Max: 25

# Pending
Layout/SpaceBeforeFirstArg:
Description: >-
Checks that exactly one space is used between a method name
and the first argument for method calls without parentheses.
Enabled: false

# Disabled
Style/Documentation:
Description: 'Document classes and non-namespace modules.'
Enabled: false

# Modified
Metrics/MethodLength:
Description: 'Avoid methods longer than 10 lines of code.'
CountComments: false # count full line comments?
Enabled: true
Max: 100

# Disabled
Style/ClassAndModuleChildren:
Description: 'Checks style of children classes and modules.'
Enabled: false
# Checks the style of children definitions at classes and modules.
#
# Basically there are two different styles:
#
# `nested` - have each child on a separate line
# class Foo
# class Bar
# end
# end
#
# `compact` - combine definitions as much as possible
# class Foo::Bar
# end
#
# The compact style is only forced, for classes / modules with one child.
EnforcedStyle: nested
SupportedStyles:
- nested
- compact

# Disabled
Style/Lambda:
Description: 'Use the new lambda literal syntax for single-line blocks.'
Enabled: false

# Disabled
Style/MethodCallWithoutArgsParentheses:
Description: 'Do not use parentheses for method calls with no arguments.'
Enabled: false

# Modified
Style/PercentLiteralDelimiters:
Description: 'Use `%`-literal delimiters consistently'
Enabled: true
PreferredDelimiters:
'%': ()
'%i': '[]'
'%q': ()
'%Q': ()
'%r': '{}'
'%s': ()
'%w': '[]'
'%W': '[]'
'%x': ()

# Modified
# Avoid complex methods.
Metrics/CyclomaticComplexity:
Description: 'Avoid complex methods.'
Enabled: true
Max: 15

# Disabled
Style/AndOr:
Description: 'Use &&/|| instead of and/or.'
Enabled: false

# Modified
# Align with the style guide.
Style/CollectionMethods:
Description: 'Preferred collection methods.'
Enabled: true
# Mapping from undesired method to desired_method
# e.g. to use `detect` over `find`:
#
# CollectionMethods:
# PreferredMethods:
# find: detect
PreferredMethods:
collect: 'map'
collect!: 'map!'
# inject: 'reduce'
detect: 'find'
find_all: 'select'

# Disabled
Style/LineEndConcatenation:
Description: >-
Use \ instead of + or << to concatenate two string literals at
line end.
Enabled: false

# Modified
Metrics/ClassLength:
Description: 'Avoid classes longer than 100 lines of code.'
Enabled: true
CountComments: false # count full line comments?
Max: 1000

# Modified
# Align the elements of a hash literal if they span more than one line.
Layout/AlignHash:
Description: >-
Align the elements of a hash literal if they span more than
one line.
Enabled: true
# Alignment of entries using hash rocket as separator. Valid values are:
#
# key - left alignment of keys
# 'a' => 2
# 'bb' => 3
# separator - alignment of hash rockets, keys are right aligned
# 'a' => 2
# 'bb' => 3
# table - left alignment of keys, hash rockets, and values
# 'a' => 2
# 'bb' => 3
EnforcedHashRocketStyle: table
# Alignment of entries using colon as separator. Valid values are:
#
# key - left alignment of keys
# a: 0
# bb: 1
# separator - alignment of colons, keys are right aligned
# a: 0
# bb: 1
# table - left alignment of keys and values
# a: 0
# bb: 1
EnforcedColonStyle: table
# Select whether hashes that are the last argument in a method call should be
# inspected? Valid values are:
#
# always_inspect - Inspect both implicit and explicit hashes.
# Registers an offence for:
# function(a: 1,
# b: 2)
# Registers an offence for:
# function({a: 1,
# b: 2})
# always_ignore - Ignore both implicit and explicit hashes.
# Accepts:
# function(a: 1,
# b: 2)
# Accepts:
# function({a: 1,
# b: 2})
# ignore_implicit - Ignore only implicit hashes.
# Accepts:
# function(a: 1,
# b: 2)
# Registers an offence for:
# function({a: 1,
# b: 2})
# ignore_explicit - Ignore only explicit hashes.
# Accepts:
# function({a: 1,
# b: 2})
# Registers an offence for:
# function(a: 1,
# b: 2)
EnforcedLastArgumentHashStyle: always_inspect
SupportedLastArgumentHashStyles:
- always_inspect
- always_ignore
- ignore_implicit
- ignore_explicit

# Disabled
Style/NumericLiterals:
Description: >-
Add underscores to large numeric literals to improve their
readability.
Enabled: false
MinDigits: 5

# Keep
Style/RedundantReturn:
Description: "Don't use return where it's not required."
Enabled: true
# When true allows code like `return x, y`.
AllowMultipleReturnValues: false

# Disabled
Style/SingleLineBlockParams:
Description: 'Enforces the names of some block params.'
Enabled: false
Methods:
- reduce:
- a
- e
- inject:
- a
- e

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
language: ruby
rvm:
- 2.2.0
- 2.3.6
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in fluent-mixin-ec2meta-placeholders.gemspec
gemspec

gem 'ec2_meta', git: 'https://github.com/leonis/ec2_meta.git'

group :development, :test do
gem 'pry-byebug'
gem 'gem-release'
Expand Down
Loading

0 comments on commit 62eca2d

Please sign in to comment.