-
Notifications
You must be signed in to change notification settings - Fork 314
Rubocop 0.79 #437
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Rubocop 0.79 #437
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
c8bfd14
Update rubocop version and the config files.
hainesr a3245ac
Add Rubocop tasks to the Rakefile.
hainesr aa40035
Fix Gemspec/OrderedDependencies cop.
hainesr 73e405a
Fix Security/Open cop errors.
hainesr f1154c2
Fix Style/OrAssignment cop.
hainesr 3a3ac6f
Fix Style/Semicolon cop.
hainesr e7275da
Fix Style/BlockDelimiters cop errors.
hainesr 98c6969
Fix Layout/SpaceAroundOperators cop.
hainesr 20743a5
Fix Lint/AmbiguousBlockAssociation cop.
hainesr b528cae
Fix Lint/LiteralAsCondition cop.
hainesr cd065d0
Fix Lint/UnusedBlockArgument cop.
hainesr e361a47
Configure Lint/UselessComparison cop.
hainesr 23ba1af
Fix Lint/RescueException cop.
hainesr 0d49421
Fix Lint/UselessAccessModifier cop.
hainesr fff2c41
Configure Lint/SuppressedException cop.
hainesr cfe4972
Fix Layout/EmptyLineAfterGuardClause cop.
hainesr 61c83b2
Configure Layout/HashAlignment cop.
hainesr 68259ed
Fix Style/Encoding cop.
hainesr 70d036b
Fix Style/ExpandPathArguments cop.
hainesr 6544563
Configure Style/ZeroLengthPredicate so it doesn't misfire.
hainesr 19aa7e8
Fix Style/RescueStandardError cop.
hainesr 5a1baf4
Fix Style/RedundantReturn cop.
hainesr b3c4c37
Fix Style/NonNilCheck cop.
hainesr b3f2413
Fix Style/CommentedKeyword cop.
hainesr 468a80c
Fix Style/IfInsideElse cop.
hainesr 3121ad0
Fix Style/Alias cop.
hainesr 1b8f1a6
Fix Naming/RescuedExceptionsVariableName cop.
hainesr bce8416
Fix Style/MixinUsage cop.
hainesr 45f4c2d
Fix Style/GuardClause cop.
hainesr 2e11a88
Fix Style/StringLiterals cop.
hainesr cc0e372
Configure Style/SymbolArray cop.
hainesr 4e1b679
Fix Style/TrailingCommaInArrayLiteral cop.
hainesr 2dfe092
Fix Style/UnpackFirst cop.
hainesr 41f2359
Configure Style/RegexpLiteral cop.
hainesr 5e32204
Configure Style/MultilineBlockChain cop.
hainesr 172ab4b
Fix Style/FloatDivision cop.
hainesr d42c66c
Fix Style/MultilineWhenThen cop.
hainesr 2dc9b49
Fix Style/EvalWithLocation cop.
hainesr 835843d
Fix Naming/HeredocDelimiterCase cop.
hainesr 7978abb
Configure Naming/MemoizedInstanceVariableName cop.
hainesr 2f99322
Fix Style/Next cop.
hainesr 2cbdbf1
Fix Style/SignalException cop.
hainesr bb3b447
Fix Style/SpecialGlobalVars cop.
hainesr 0df6cb3
Fix Style/SymbolProc cop.
hainesr 6cab592
Configure and fix Metrics/LineLength cop.
hainesr 0e25e63
Turn off Metrics/BlockLength for the tests.
hainesr c97d560
Configure Metrics/AbcSize and turn off for the tests.
hainesr 5ce4e13
Configure and fix Style/ClassCheck cop.
hainesr a9adfa2
Configure Metrics/ClassLength and turn off for the tests.
hainesr a187ec0
Configure Metrics/MethodLength and turn off for the tests.
hainesr 4b8f740
Fix Layout/EmptyLinesAroundClassBody cop.
hainesr fae95e3
Fix Style/NumericLiteralPrefix cop.
hainesr d07b36b
Fix Style/TernaryParentheses cop.
hainesr 989a565
Fix Style/TrailingCommaInHashLiteral cop.
hainesr c31ab81
Fix Style/NumericLiterals cop.
hainesr 87a63e0
Set TargetRubyVersion to match that in the gemspec.
hainesr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.