Configure Layout/HashAlignment cop.
This commit is contained in:
parent
cfe4972e71
commit
61c83b2a1a
|
@ -1,5 +1,9 @@
|
||||||
inherit_from: .rubocop_todo.yml
|
inherit_from: .rubocop_todo.yml
|
||||||
|
|
||||||
|
Layout/HashAlignment:
|
||||||
|
EnforcedHashRocketStyle: table
|
||||||
|
EnforcedColonStyle: table
|
||||||
|
|
||||||
# In some cases we just need to catch an exception, rather than
|
# In some cases we just need to catch an exception, rather than
|
||||||
# actually handle it. Allow the tests to make use of this shortcut.
|
# actually handle it. Allow the tests to make use of this shortcut.
|
||||||
Lint/SuppressedException:
|
Lint/SuppressedException:
|
||||||
|
|
|
@ -14,18 +14,6 @@ Layout/EmptyLinesAroundClassBody:
|
||||||
Exclude:
|
Exclude:
|
||||||
- 'test/extra_field_ut_test.rb'
|
- 'test/extra_field_ut_test.rb'
|
||||||
|
|
||||||
# Offense count: 26
|
|
||||||
# Cop supports --auto-correct.
|
|
||||||
# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
|
|
||||||
# SupportedHashRocketStyles: key, separator, table
|
|
||||||
# SupportedColonStyles: key, separator, table
|
|
||||||
# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
|
|
||||||
Layout/HashAlignment:
|
|
||||||
Exclude:
|
|
||||||
- 'lib/zip/constants.rb'
|
|
||||||
- 'lib/zip/file.rb'
|
|
||||||
- 'rubyzip.gemspec'
|
|
||||||
|
|
||||||
# Offense count: 120
|
# Offense count: 120
|
||||||
Metrics/AbcSize:
|
Metrics/AbcSize:
|
||||||
Max: 60
|
Max: 60
|
||||||
|
|
|
@ -87,29 +87,29 @@ module Zip
|
||||||
COMPRESSION_METHOD_AES = 99
|
COMPRESSION_METHOD_AES = 99
|
||||||
|
|
||||||
COMPRESSION_METHODS = {
|
COMPRESSION_METHODS = {
|
||||||
COMPRESSION_METHOD_STORE => 'Store (no compression)',
|
COMPRESSION_METHOD_STORE => 'Store (no compression)',
|
||||||
COMPRESSION_METHOD_SHRINK => 'Shrink',
|
COMPRESSION_METHOD_SHRINK => 'Shrink',
|
||||||
COMPRESSION_METHOD_REDUCE_1 => 'Reduce with compression factor 1',
|
COMPRESSION_METHOD_REDUCE_1 => 'Reduce with compression factor 1',
|
||||||
COMPRESSION_METHOD_REDUCE_2 => 'Reduce with compression factor 2',
|
COMPRESSION_METHOD_REDUCE_2 => 'Reduce with compression factor 2',
|
||||||
COMPRESSION_METHOD_REDUCE_3 => 'Reduce with compression factor 3',
|
COMPRESSION_METHOD_REDUCE_3 => 'Reduce with compression factor 3',
|
||||||
COMPRESSION_METHOD_REDUCE_4 => 'Reduce with compression factor 4',
|
COMPRESSION_METHOD_REDUCE_4 => 'Reduce with compression factor 4',
|
||||||
COMPRESSION_METHOD_IMPLODE => 'Implode',
|
COMPRESSION_METHOD_IMPLODE => 'Implode',
|
||||||
# RESERVED = 7
|
# RESERVED = 7
|
||||||
COMPRESSION_METHOD_DEFLATE => 'Deflate',
|
COMPRESSION_METHOD_DEFLATE => 'Deflate',
|
||||||
COMPRESSION_METHOD_DEFLATE_64 => 'Deflate64(tm)',
|
COMPRESSION_METHOD_DEFLATE_64 => 'Deflate64(tm)',
|
||||||
COMPRESSION_METHOD_PKWARE_DCLI => 'PKWARE Data Compression Library Imploding (old IBM TERSE)',
|
COMPRESSION_METHOD_PKWARE_DCLI => 'PKWARE Data Compression Library Imploding (old IBM TERSE)',
|
||||||
# RESERVED = 11
|
# RESERVED = 11
|
||||||
COMPRESSION_METHOD_BZIP2 => 'BZIP2',
|
COMPRESSION_METHOD_BZIP2 => 'BZIP2',
|
||||||
# RESERVED = 13
|
# RESERVED = 13
|
||||||
COMPRESSION_METHOD_LZMA => 'LZMA',
|
COMPRESSION_METHOD_LZMA => 'LZMA',
|
||||||
# RESERVED = 15
|
# RESERVED = 15
|
||||||
COMPRESSION_METHOD_IBM_CMPSC => 'IBM z/OS CMPSC Compression',
|
COMPRESSION_METHOD_IBM_CMPSC => 'IBM z/OS CMPSC Compression',
|
||||||
# RESERVED = 17
|
# RESERVED = 17
|
||||||
COMPRESSION_METHOD_IBM_TERSE => 'IBM TERSE (new)',
|
COMPRESSION_METHOD_IBM_TERSE => 'IBM TERSE (new)',
|
||||||
COMPRESSION_METHOD_IBM_LZ77 => 'IBM LZ77 z Architecture (PFS)',
|
COMPRESSION_METHOD_IBM_LZ77 => 'IBM LZ77 z Architecture (PFS)',
|
||||||
COMPRESSION_METHOD_JPEG => 'JPEG variant',
|
COMPRESSION_METHOD_JPEG => 'JPEG variant',
|
||||||
COMPRESSION_METHOD_WAVPACK => 'WavPack compressed data',
|
COMPRESSION_METHOD_WAVPACK => 'WavPack compressed data',
|
||||||
COMPRESSION_METHOD_PPMD => 'PPMd version I, Rev 1',
|
COMPRESSION_METHOD_PPMD => 'PPMd version I, Rev 1',
|
||||||
COMPRESSION_METHOD_AES => 'AES encryption',
|
COMPRESSION_METHOD_AES => 'AES encryption',
|
||||||
}.freeze
|
}.freeze
|
||||||
end
|
end
|
||||||
|
|
|
@ -434,9 +434,11 @@ class ZipFsFileNonmutatingTest < MiniTest::Test
|
||||||
::Zip::File.open('test/data/globTest.zip') do |zf|
|
::Zip::File.open('test/data/globTest.zip') do |zf|
|
||||||
{
|
{
|
||||||
'globTest/foo.txt' => ['globTest/foo.txt'],
|
'globTest/foo.txt' => ['globTest/foo.txt'],
|
||||||
'*/foo.txt' => ['globTest/foo.txt'],
|
'*/foo.txt' => ['globTest/foo.txt'],
|
||||||
'**/foo.txt' => ['globTest/foo.txt', 'globTest/foo/bar/baz/foo.txt'],
|
'**/foo.txt' => [
|
||||||
'*/foo/**/*.txt' => ['globTest/foo/bar/baz/foo.txt']
|
'globTest/foo.txt', 'globTest/foo/bar/baz/foo.txt'
|
||||||
|
],
|
||||||
|
'*/foo/**/*.txt' => ['globTest/foo/bar/baz/foo.txt']
|
||||||
}.each do |spec, expected_results|
|
}.each do |spec, expected_results|
|
||||||
results = zf.glob(spec)
|
results = zf.glob(spec)
|
||||||
assert(results.all? { |entry| entry.is_a? ::Zip::Entry })
|
assert(results.all? { |entry| entry.is_a? ::Zip::Entry })
|
||||||
|
|
|
@ -62,7 +62,7 @@ class PathTraversalTest < MiniTest::Test
|
||||||
|
|
||||||
def test_non_leading_dot_dot_with_existing_folder
|
def test_non_leading_dot_dot_with_existing_folder
|
||||||
entries = {
|
entries = {
|
||||||
'tmp/' => '',
|
'tmp/' => '',
|
||||||
'tmp/../../moo' => /WARNING: skipped \'tmp\/\.\.\/\.\.\/moo\'/
|
'tmp/../../moo' => /WARNING: skipped \'tmp\/\.\.\/\.\.\/moo\'/
|
||||||
}
|
}
|
||||||
in_tmpdir do
|
in_tmpdir do
|
||||||
|
@ -92,7 +92,7 @@ class PathTraversalTest < MiniTest::Test
|
||||||
def test_directory_symlink
|
def test_directory_symlink
|
||||||
# Can't create tmp/moo, because the tmp symlink is skipped.
|
# Can't create tmp/moo, because the tmp symlink is skipped.
|
||||||
entries = {
|
entries = {
|
||||||
'tmp' => /WARNING: skipped symlink \'tmp\'/,
|
'tmp' => /WARNING: skipped symlink \'tmp\'/,
|
||||||
'tmp/moo' => :error
|
'tmp/moo' => :error
|
||||||
}
|
}
|
||||||
in_tmpdir do
|
in_tmpdir do
|
||||||
|
@ -104,8 +104,8 @@ class PathTraversalTest < MiniTest::Test
|
||||||
def test_two_directory_symlinks_a
|
def test_two_directory_symlinks_a
|
||||||
# Can't create par/moo because the symlinks are skipped.
|
# Can't create par/moo because the symlinks are skipped.
|
||||||
entries = {
|
entries = {
|
||||||
'cur' => /WARNING: skipped symlink \'cur\'/,
|
'cur' => /WARNING: skipped symlink \'cur\'/,
|
||||||
'par' => /WARNING: skipped symlink \'par\'/,
|
'par' => /WARNING: skipped symlink \'par\'/,
|
||||||
'par/moo' => :error
|
'par/moo' => :error
|
||||||
}
|
}
|
||||||
in_tmpdir do
|
in_tmpdir do
|
||||||
|
@ -119,7 +119,7 @@ class PathTraversalTest < MiniTest::Test
|
||||||
def test_two_directory_symlinks_b
|
def test_two_directory_symlinks_b
|
||||||
# Can't create par/moo, because the symlinks are skipped.
|
# Can't create par/moo, because the symlinks are skipped.
|
||||||
entries = {
|
entries = {
|
||||||
'cur' => /WARNING: skipped symlink \'cur\'/,
|
'cur' => /WARNING: skipped symlink \'cur\'/,
|
||||||
'cur/par' => /WARNING: skipped symlink \'cur\/par\'/,
|
'cur/par' => /WARNING: skipped symlink \'cur\/par\'/,
|
||||||
'par/moo' => :error
|
'par/moo' => :error
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ class PathTraversalTest < MiniTest::Test
|
||||||
|
|
||||||
def test_entry_name_with_absolute_path_does_not_extract
|
def test_entry_name_with_absolute_path_does_not_extract
|
||||||
entries = {
|
entries = {
|
||||||
'/tmp/' => /WARNING: skipped \'\/tmp\/\'/,
|
'/tmp/' => /WARNING: skipped \'\/tmp\/\'/,
|
||||||
'/tmp/file.txt' => /WARNING: skipped \'\/tmp\/file.txt\'/
|
'/tmp/file.txt' => /WARNING: skipped \'\/tmp\/file.txt\'/
|
||||||
}
|
}
|
||||||
in_tmpdir do
|
in_tmpdir do
|
||||||
|
@ -156,7 +156,7 @@ class PathTraversalTest < MiniTest::Test
|
||||||
def test_entry_name_with_relative_symlink
|
def test_entry_name_with_relative_symlink
|
||||||
# Doesn't create the symlink path, so can't create path/file.txt.
|
# Doesn't create the symlink path, so can't create path/file.txt.
|
||||||
entries = {
|
entries = {
|
||||||
'path' => /WARNING: skipped symlink \'path\'/,
|
'path' => /WARNING: skipped symlink \'path\'/,
|
||||||
'path/file.txt' => :error
|
'path/file.txt' => :error
|
||||||
}
|
}
|
||||||
in_tmpdir do
|
in_tmpdir do
|
||||||
|
|
Loading…
Reference in New Issue