Skip to content

Commit

Permalink
Merge pull request #437 from hainesr/rubocop-0.79
Browse files Browse the repository at this point in the history
Rubocop 0.79
  • Loading branch information
jdleesmiller committed Feb 16, 2020
2 parents 5da87ef + 87a63e0 commit 10685a7
Show file tree
Hide file tree
Showing 57 changed files with 621 additions and 403 deletions.
88 changes: 83 additions & 5 deletions .rubocop.yml
@@ -1,6 +1,84 @@
inherit_from:
- .rubocop_rubyzip.yml
inherit_from: .rubocop_todo.yml

# Set this to the minimum supported ruby in the gemspec. Otherwise
# we get errors if our ruby version doesn't match.
AllCops:
TargetRubyVersion: 1.9
Style/MutableConstant:
Enabled: false # Because some existent code relies on mutable constant
TargetRubyVersion: 2.4

Layout/HashAlignment:
EnforcedHashRocketStyle: table
EnforcedColonStyle: table

# Set a workable line length, given the current state of the code,
# and turn off for the tests.
Layout/LineLength:
Max: 135
Exclude:
- 'test/**/*.rb'

# In some cases we just need to catch an exception, rather than
# actually handle it. Allow the tests to make use of this shortcut.
Lint/SuppressedException:
AllowComments: true
Exclude:
- 'test/**/*.rb'

# Allow this "useless" test, as we are testing <=> here.
Lint/UselessComparison:
Exclude:
- 'test/entry_test.rb'

# Turn off ABC metrics for the tests and set a workable max given
# the current state of the code.
Metrics/AbcSize:
Max: 37
Exclude:
- 'test/**/*.rb'

# Turn block length metrics off for the tests.
Metrics/BlockLength:
Exclude:
- 'test/**/*.rb'

# Turn class length metrics off for the tests.
Metrics/ClassLength:
Exclude:
- 'test/**/*.rb'

# Turn method length metrics off for the tests.
Metrics/MethodLength:
Exclude:
- 'test/**/*.rb'

# Rubocop confuses these as instances of "memoization".
Naming/MemoizedInstanceVariableName:
Exclude:
- 'lib/zip/extra_field/old_unix.rb'
- 'lib/zip/extra_field/unix.rb'

# Set a consistent way of checking types.
Style/ClassCheck:
EnforcedStyle: kind_of?

# Allow this multi-line block chain as it actually reads better
# than the alternatives.
Style/MultilineBlockChain:
Exclude:
- 'lib/zip/crypto/traditional_encryption.rb'

# Allow inner slashes when using // for regex literals. Allow the
# Guardfile to use a syntax that is more consistent with its own style.
Style/RegexpLiteral:
AllowInnerSlashes: true
Exclude:
- 'Guardfile'

Style/SymbolArray:
EnforcedStyle: brackets

# Turn this cop off for these files as it fires for objects without
# an empty? method.
Style/ZeroLengthPredicate:
Exclude:
- 'lib/zip/file.rb'
- 'lib/zip/input_stream.rb'
137 changes: 0 additions & 137 deletions .rubocop_rubyzip.yml

This file was deleted.

164 changes: 164 additions & 0 deletions .rubocop_todo.yml
@@ -0,0 +1,164 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2020-02-08 14:58:51 +0000 using RuboCop version 0.79.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
# versions of RuboCop, may require this file to be generated again.

# Offense count: 15
# Configuration parameters: CountComments.
Metrics/ClassLength:
Max: 580

# Offense count: 26
Metrics/CyclomaticComplexity:
Max: 14

# Offense count: 120
# Configuration parameters: CountComments, ExcludedMethods.
Metrics/MethodLength:
Max: 30

# Offense count: 2
# Configuration parameters: CountKeywordArgs.
Metrics/ParameterLists:
Max: 10

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

# Offense count: 9
Naming/AccessorMethodName:
Exclude:
- 'lib/zip/entry.rb'
- 'lib/zip/filesystem.rb'
- 'lib/zip/input_stream.rb'
- 'lib/zip/streamable_stream.rb'
- 'test/file_permissions_test.rb'

# Offense count: 18
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
Naming/BlockParameterName:
Exclude:
- 'lib/zip/file.rb'
- 'lib/zip/filesystem.rb'
- 'samples/zipfind.rb'
- 'test/central_directory_test.rb'
- 'test/file_extract_directory_test.rb'
- 'test/file_extract_test.rb'
- 'test/output_stream_test.rb'
- 'test/test_helper.rb'

# Offense count: 140
# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
# AllowedNames: io, id, to, by, on, in, at, ip, db, os
Naming/MethodParameterName:
Enabled: false

# Offense count: 721
# Configuration parameters: EnforcedStyle.
# SupportedStyles: snake_case, camelCase
Naming/VariableName:
Enabled: false

# Offense count: 7
# Configuration parameters: EnforcedStyle.
# SupportedStyles: inline, group
Style/AccessModifierDeclarations:
Exclude:
- 'lib/zip/central_directory.rb'
- 'lib/zip/extra_field/zip64.rb'
- 'lib/zip/filesystem.rb'

# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle.
# SupportedStyles: nested, compact
Style/ClassAndModuleChildren:
Exclude:
- 'lib/zip/extra_field/generic.rb'
- 'lib/zip/extra_field/ntfs.rb'
- 'lib/zip/extra_field/old_unix.rb'
- 'lib/zip/extra_field/universal_time.rb'
- 'lib/zip/extra_field/unix.rb'
- 'lib/zip/extra_field/zip64.rb'
- 'lib/zip/extra_field/zip64_placeholder.rb'

# Offense count: 26
Style/Documentation:
Enabled: false

# Offense count: 3
# Configuration parameters: .
# SupportedStyles: annotated, template, unannotated
Style/FormatStringToken:
EnforcedStyle: unannotated

# Offense count: 95
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, never
Style/FrozenStringLiteralComment:
Enabled: false

# Offense count: 17
# Cop supports --auto-correct.
Style/IfUnlessModifier:
Exclude:
- 'lib/zip/entry.rb'
- 'lib/zip/extra_field/generic.rb'
- 'lib/zip/file.rb'
- 'lib/zip/filesystem.rb'
- 'lib/zip/input_stream.rb'
- 'lib/zip/pass_thru_decompressor.rb'
- 'lib/zip/streamable_stream.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, Autocorrect.
# SupportedStyles: module_function, extend_self
Style/ModuleFunction:
Exclude:
- 'lib/zip.rb'

# Offense count: 56
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: literals, strict
Style/MutableConstant:
Enabled: false

# Offense count: 23
# Cop supports --auto-correct.
# Configuration parameters: AutoCorrect, EnforcedStyle, IgnoredMethods.
# SupportedStyles: predicate, comparison
Style/NumericPredicate:
Exclude:
- 'spec/**/*'
- 'lib/zip/entry.rb'
- 'lib/zip/extra_field/old_unix.rb'
- 'lib/zip/extra_field/universal_time.rb'
- 'lib/zip/extra_field/unix.rb'
- 'lib/zip/file.rb'
- 'lib/zip/filesystem.rb'
- 'lib/zip/input_stream.rb'
- 'lib/zip/ioextras.rb'
- 'lib/zip/ioextras/abstract_input_stream.rb'
- 'test/file_split_test.rb'
- 'test/test_helper.rb'

# Offense count: 17
# Cop supports --auto-correct.
# Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods.
# AllowedMethods: present?, blank?, presence, try, try!
Style/SafeNavigation:
Exclude:
- 'lib/zip/entry.rb'
- 'lib/zip/input_stream.rb'
- 'lib/zip/output_stream.rb'
- 'test/file_extract_test.rb'
- 'test/filesystem/file_nonmutating_test.rb'
- 'test/filesystem/file_stat_test.rb'
- 'test/test_helper.rb'

0 comments on commit 10685a7

Please sign in to comment.