Skip to content

Commit

Permalink
Fix code style via RuboCop
Browse files Browse the repository at this point in the history
  • Loading branch information
alsemyonov committed Mar 5, 2018
1 parent ad8d5d2 commit db7e0dd
Show file tree
Hide file tree
Showing 72 changed files with 80 additions and 122 deletions.
104 changes: 68 additions & 36 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2017-04-06 23:00:54 +0300 using RuboCop version 0.48.1.
# on 2018-03-05 12:15:50 +0300 using RuboCop version 0.53.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -9,16 +9,34 @@
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: Include, TreatCommentsAsGroupSeparators.
# Include: **/Gemfile, **/gems.rb
# Include: **/*.gemfile, **/Gemfile, **/gems.rb
Bundler/OrderedGems:
Exclude:
- 'Gemfile'

# Offense count: 7
# Cop supports --auto-correct.
Layout/EmptyLineAfterMagicComment:
Exclude:
- 'Gemfile'
- 'Rakefile'
- 'bin/console'
- 'bin/rake'
- 'bin/rubocop'
- 'example/atom.rb'
- 'example/xml.rb'

# Offense count: 1
Lint/ShadowingOuterLocalVariable:
Exclude:
- 'example/atom.rb'

# Offense count: 1
# Configuration parameters: CheckForMethodsWithNoSideEffects.
Lint/Void:
Exclude:
- 'lib/xommelier/xml/schema.rb'

# Offense count: 9
Metrics/AbcSize:
Max: 70
Expand All @@ -32,26 +50,43 @@ Metrics/BlockLength:
Metrics/CyclomaticComplexity:
Max: 14

# Offense count: 125
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 265

# Offense count: 10
# Offense count: 9
# Configuration parameters: CountComments.
Metrics/MethodLength:
Max: 46

# Offense count: 1
# Configuration parameters: CountComments.
Metrics/ModuleLength:
Max: 203
Max: 199

# Offense count: 3
Metrics/PerceivedComplexity:
Max: 15

# Offense count: 1
Naming/MemoizedInstanceVariableName:
Exclude:
- 'lib/xommelier/rss.rb'

# Offense count: 1
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist, MethodDefinitionMacros.
# NamePrefix: is_, has_, have_
# NamePrefixBlacklist: is_, has_, have_
# NameWhitelist: is_a?
# MethodDefinitionMacros: define_method, define_singleton_method
Naming/PredicateName:
Exclude:
- 'spec/**/*'
- 'lib/xommelier/ds.rb'

# Offense count: 1
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: io, id
Naming/UncommunicativeMethodParamName:
Exclude:
- 'lib/xommelier/xml/element/serialization.rb'

# Offense count: 1
RSpec/DescribeSymbol:
Exclude:
Expand Down Expand Up @@ -84,7 +119,7 @@ RSpec/EmptyLineAfterSubject:
- 'spec/lib/xommelier/ds/transform_spec.rb'

# Offense count: 101
# Configuration parameters: EnforcedStyle, SupportedStyles.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: is_expected, should
RSpec/ImplicitExpect:
Exclude:
Expand Down Expand Up @@ -115,6 +150,7 @@ RSpec/LeadingSubject:
- 'spec/lib/xommelier/ds/signature_spec.rb'

# Offense count: 1
# Configuration parameters: AggregateFailuresByDefault.
RSpec/MultipleExpectations:
Max: 2

Expand All @@ -137,7 +173,13 @@ RSpec/RepeatedExample:
Exclude:
- 'spec/functional/xommelier/rss/rss/parsing_spec.rb'

# Offense count: 1
Security/Open:
Exclude:
- 'spec/support/fixtures.rb'

# Offense count: 69
# Configuration parameters: AllowedChars.
Style/AsciiComments:
Enabled: false

Expand All @@ -147,7 +189,8 @@ Style/CaseEquality:
- 'lib/xommelier/xml/element/serialization.rb'

# Offense count: 1
# Configuration parameters: EnforcedStyle, SupportedStyles.
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
Exclude:
Expand All @@ -168,18 +211,6 @@ Style/EachWithObject:
Exclude:
- 'lib/xommelier/xml/element/serialization.rb'

# Offense count: 7
# Cop supports --auto-correct.
Style/EmptyLineAfterMagicComment:
Exclude:
- 'Gemfile'
- 'Rakefile'
- 'bin/console'
- 'bin/rake'
- 'bin/rubocop'
- 'example/atom.rb'
- 'example/xml.rb'

# Offense count: 2
# Configuration parameters: MinBodyLength.
Style/GuardClause:
Expand All @@ -197,6 +228,11 @@ Style/MethodMissing:
Exclude:
- 'lib/xommelier/rss.rb'

# Offense count: 1
Style/MixinUsage:
Exclude:
- 'example/atom.rb'

# Offense count: 1
# Cop supports --auto-correct.
Style/MultilineIfModifier:
Expand All @@ -214,16 +250,6 @@ Style/PercentLiteralDelimiters:
- 'spec/lib/xommelier/atom/entry_spec.rb'
- 'spec/lib/xommelier/xml/element_spec.rb'

# Offense count: 1
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist.
# NamePrefix: is_, has_, have_
# NamePrefixBlacklist: is_, has_, have_
# NameWhitelist: is_a?
Style/PredicateName:
Exclude:
- 'spec/**/*'
- 'lib/xommelier/ds.rb'

# Offense count: 4
# Cop supports --auto-correct.
Style/RedundantFreeze:
Expand All @@ -235,15 +261,21 @@ Style/RedundantFreeze:

# Offense count: 3
# Cop supports --auto-correct.
# Configuration parameters: SupportedStyles.
# Configuration parameters: MinSize.
# SupportedStyles: percent, brackets
Style/SymbolArray:
EnforcedStyle: brackets

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowSafeAssignment.
# Configuration parameters: EnforcedStyle, AllowSafeAssignment.
# SupportedStyles: require_parentheses, require_no_parentheses, require_parentheses_when_complex
Style/TernaryParentheses:
Exclude:
- 'lib/xommelier/xml/element/serialization.rb'

# Offense count: 125
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
# URISchemes: http, https
Metrics/LineLength:
Max: 265
2 changes: 1 addition & 1 deletion bin/console
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ rescue LoadError
end
require 'pp'

SPEC_ROOT = File.expand_path('..', __FILE__)
SPEC_ROOT = File.expand_path(__dir__)

Dir[File.join(SPEC_ROOT, 'spec/support/**/*.rb')].each { |f| require f }

Expand Down
1 change: 0 additions & 1 deletion lib/xommelier.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/atom.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/atom/category.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/atom/content.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/atom/entry.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/atom/feed.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/atom/full.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/atom/generator.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/atom/history.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/atom/link.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/atom/links_extension.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/atom/person.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/atom/source.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/atom/threading.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
3 changes: 1 addition & 2 deletions lib/xommelier/common.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand All @@ -18,7 +17,7 @@ def self.from_xommelier(value)
when String
value = begin
rfc2822(value)
rescue
rescue StandardError
parse(value)
end
at(value)
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/core_ext.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/core_ext/boolean.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/core_ext/date.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/core_ext/float.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
3 changes: 1 addition & 2 deletions lib/xommelier/core_ext/numeric.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand All @@ -10,7 +9,7 @@ class Numeric
def self.from_xommelier(value)
return nil if value.blank?
begin
value =~ /\./ ? Float(value) : Integer(value)
value.match?(/\./) ? Float(value) : Integer(value)
rescue ArgumentError
value
end
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/core_ext/string.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/core_ext/symbol.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/core_ext/time.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/core_ext/uri.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/ds.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/dsig11.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/factory_girl.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/open_search.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/opml.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/rss.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/rss/atomic.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
1 change: 0 additions & 1 deletion lib/xommelier/sitemap.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# coding: utf-8
# frozen_string_literal: true

################################################
Expand Down
Loading

0 comments on commit db7e0dd

Please sign in to comment.