mirror of
https://github.com/nishiki/manage-password.git
synced 2024-11-22 21:37:52 +00:00
feat: update rubocop to 0.50.0
This commit is contained in:
parent
dd02776baa
commit
ce02022ac7
27 changed files with 39 additions and 155 deletions
109
.rubocop.yml
109
.rubocop.yml
|
@ -6,116 +6,33 @@ AllCops:
|
|||
- Vagrantfile
|
||||
TargetRubyVersion: 2.3
|
||||
|
||||
Style/AccessorMethodName:
|
||||
Naming/AccessorMethodName:
|
||||
Enabled: false
|
||||
Style/NumericLiteralPrefix:
|
||||
Enabled: false
|
||||
Style/TrailingCommaInArguments:
|
||||
Enabled: false
|
||||
Style/TrailingCommaInLiteral:
|
||||
Enabled: false
|
||||
Style/FrozenStringLiteralComment:
|
||||
Enabled: false
|
||||
Metrics/ParameterLists:
|
||||
Max: 5
|
||||
CountKeywordArgs: false
|
||||
Style/MutableConstant:
|
||||
|
||||
Lint/RescueWithoutErrorClass:
|
||||
Enabled: false
|
||||
|
||||
Metrics/LineLength:
|
||||
Max: 120
|
||||
Metrics/AbcSize:
|
||||
Metrics/CyclomaticComplexity:
|
||||
Enabled: false
|
||||
Metrics/PerceivedComplexity:
|
||||
Enabled: false
|
||||
Metrics/MethodLength:
|
||||
Enabled: false
|
||||
Metrics/BlockLength:
|
||||
Enabled: false
|
||||
Metrics/CyclomaticComplexity:
|
||||
Enabled: false
|
||||
Metrics/PerceivedComplexity:
|
||||
Enabled: false
|
||||
Metrics/ClassLength:
|
||||
Enabled: false
|
||||
Style/SpaceInsideHashLiteralBraces:
|
||||
Enabled: false
|
||||
Style/AsciiComments:
|
||||
Enabled: true
|
||||
Style/Documentation:
|
||||
Enabled: false
|
||||
Style/SignalException:
|
||||
Enabled: false
|
||||
Style/OptionHash:
|
||||
Enabled: true
|
||||
Style/SymbolArray:
|
||||
Enabled: true
|
||||
Performance/Casecmp:
|
||||
Enabled: false
|
||||
Style/DoubleNegation:
|
||||
Enabled: false
|
||||
Style/Alias:
|
||||
EnforcedStyle: prefer_alias_method
|
||||
Style/MultilineMethodCallIndentation:
|
||||
EnforcedStyle: indented
|
||||
Style/RaiseArgs:
|
||||
EnforcedStyle: exploded
|
||||
Style/SpaceInLambdaLiteral:
|
||||
Enabled: false
|
||||
Lint/UnneededSplatExpansion:
|
||||
Metrics/AbcSize:
|
||||
Enabled: false
|
||||
|
||||
|
||||
# Generated configuration
|
||||
Style/HashSyntax:
|
||||
Enabled: true
|
||||
EnforcedStyle: ruby19
|
||||
UseHashRocketsWithSymbolValues: false
|
||||
Style/MethodDefParentheses:
|
||||
Enabled: true
|
||||
EnforcedStyle: require_parentheses
|
||||
Style/MultilineAssignmentLayout:
|
||||
Enabled: true
|
||||
EnforcedStyle: new_line
|
||||
Style/IndentationConsistency:
|
||||
Enabled: true
|
||||
EnforcedStyle: normal
|
||||
Style/AlignParameters:
|
||||
Enabled: true
|
||||
EnforcedStyle: with_fixed_indentation
|
||||
Style/BlockDelimiters:
|
||||
Enabled: true
|
||||
EnforcedStyle: line_count_based
|
||||
Style/AndOr:
|
||||
Enabled: true
|
||||
Style/DotPosition:
|
||||
Enabled: true
|
||||
EnforcedStyle: leading
|
||||
Style/EmptyLinesAroundClassBody:
|
||||
Enabled: true
|
||||
EnforcedStyle: no_empty_lines
|
||||
Style/EmptyLinesAroundModuleBody:
|
||||
Enabled: true
|
||||
EnforcedStyle: no_empty_lines
|
||||
Style/NumericPredicate:
|
||||
Enabled: true
|
||||
EnforcedStyle: comparison
|
||||
Style/EvenOdd:
|
||||
Style/NumericLiteralPrefix:
|
||||
Enabled: false
|
||||
Style/FrozenStringLiteralComment:
|
||||
Enabled: false
|
||||
Style/CollectionMethods:
|
||||
Enabled: true
|
||||
PreferredMethods:
|
||||
collect: map
|
||||
collect!: map!
|
||||
inject: reduce
|
||||
detect: find
|
||||
find_all: select
|
||||
Style/EmptyLinesAroundAccessModifier:
|
||||
Enabled: true
|
||||
Style/CommandLiteral:
|
||||
Enabled: true
|
||||
EnforcedStyle: percent_x
|
||||
Style/StringLiterals:
|
||||
Enabled: true
|
||||
EnforcedStyle: single_quotes
|
||||
Style/SpaceInsideBlockBraces:
|
||||
EnforcedStyle: space
|
||||
Style/VariableNumber:
|
||||
EnforcedStyle: snake_case
|
||||
Style/Documentation:
|
||||
Enabled: false
|
||||
|
|
2
Gemfile
2
Gemfile
|
@ -8,7 +8,7 @@ gem 'locale', '~> 2.1', '>= 2.1.2'
|
|||
gem 'rotp', '~> 3.1', '>= 3.1.0'
|
||||
|
||||
group :development do
|
||||
gem 'rubocop', '0.48.1'
|
||||
gem 'rubocop', '0.50.0'
|
||||
gem 'test-unit'
|
||||
gem 'yard'
|
||||
end
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
# MPW is a software to crypt and manage your passwords
|
||||
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
||||
#
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
# MPW is a software to crypt and manage your passwords
|
||||
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
||||
#
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
# MPW is a software to crypt and manage your passwords
|
||||
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
||||
#
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
# MPW is a software to crypt and manage your passwords
|
||||
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
||||
#
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
# MPW is a software to crypt and manage your passwords
|
||||
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
||||
#
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
# MPW is a software to crypt and manage your passwords
|
||||
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
||||
#
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
# MPW is a software to crypt and manage your passwords
|
||||
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
||||
#
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
# MPW is a software to crypt and manage your passwords
|
||||
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
||||
#
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
# MPW is a software to crypt and manage your passwords
|
||||
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
||||
#
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
# MPW is a software to crypt and manage your passwords
|
||||
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
||||
#
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
# MPW is a software to crypt and manage your passwords
|
||||
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
||||
#
|
||||
|
@ -39,7 +38,7 @@ module MPW
|
|||
@config.setup(options)
|
||||
|
||||
puts I18n.t('form.set_config.valid').to_s.green
|
||||
rescue => e
|
||||
rescue e
|
||||
puts "#{I18n.t('display.error')} #15: #{e}".red
|
||||
exit 2
|
||||
end
|
||||
|
@ -50,7 +49,7 @@ module MPW
|
|||
@config.set_wallet_path(path, @wallet)
|
||||
|
||||
puts I18n.t('form.set_wallet_path.valid').to_s.green
|
||||
rescue => e
|
||||
rescue e
|
||||
puts "#{I18n.t('display.error')} #19: #{e}".red
|
||||
exit 2
|
||||
end
|
||||
|
@ -67,7 +66,7 @@ module MPW
|
|||
load_config
|
||||
|
||||
puts I18n.t('form.setup_config.valid').to_s.green
|
||||
rescue => e
|
||||
rescue e
|
||||
puts "#{I18n.t('display.error')} #8: #{e}".red
|
||||
exit 2
|
||||
end
|
||||
|
@ -89,7 +88,7 @@ module MPW
|
|||
@config.setup_gpg_key(@password, gpg_key)
|
||||
|
||||
puts I18n.t('form.setup_gpg_key.valid').to_s.green
|
||||
rescue => e
|
||||
rescue e
|
||||
puts "#{I18n.t('display.error')} #8: #{e}".red
|
||||
exit 2
|
||||
end
|
||||
|
@ -119,7 +118,7 @@ module MPW
|
|||
# Load config
|
||||
def load_config
|
||||
@config.load_config
|
||||
rescue => e
|
||||
rescue e
|
||||
puts "#{I18n.t('display.error')} #10: #{e}".red
|
||||
exit 2
|
||||
end
|
||||
|
@ -140,7 +139,7 @@ module MPW
|
|||
@mpw.read_data
|
||||
end
|
||||
end
|
||||
rescue => e
|
||||
rescue e
|
||||
puts "#{I18n.t('display.error')} #11: #{e}".red
|
||||
exit 2
|
||||
end
|
||||
|
@ -416,7 +415,7 @@ module MPW
|
|||
@mpw.write_data
|
||||
|
||||
puts I18n.t('form.add_key.valid').to_s.green
|
||||
rescue => e
|
||||
rescue e
|
||||
puts "#{I18n.t('display.error')} #13: #{e}".red
|
||||
end
|
||||
|
||||
|
@ -427,7 +426,7 @@ module MPW
|
|||
@mpw.write_data
|
||||
|
||||
puts I18n.t('form.delete_key.valid').to_s.green
|
||||
rescue => e
|
||||
rescue e
|
||||
puts "#{I18n.t('display.error')} #15: #{e}".red
|
||||
end
|
||||
|
||||
|
@ -478,7 +477,7 @@ module MPW
|
|||
@mpw.write_data
|
||||
|
||||
puts I18n.t('form.add_item.valid').to_s.green
|
||||
rescue => e
|
||||
rescue e
|
||||
puts "#{I18n.t('display.error')} #13: #{e}".red
|
||||
end
|
||||
|
||||
|
@ -506,7 +505,7 @@ module MPW
|
|||
|
||||
puts I18n.t('form.update_item.valid').to_s.green
|
||||
end
|
||||
rescue => e
|
||||
rescue e
|
||||
puts "#{I18n.t('display.error')} #14: #{e}".red
|
||||
end
|
||||
|
||||
|
@ -530,7 +529,7 @@ module MPW
|
|||
|
||||
puts I18n.t('form.delete_item.valid').to_s.green
|
||||
end
|
||||
rescue => e
|
||||
rescue e
|
||||
puts "#{I18n.t('display.error')} #16: #{e}".red
|
||||
end
|
||||
|
||||
|
@ -548,7 +547,7 @@ module MPW
|
|||
item = get_item(items)
|
||||
clipboard(item, clipboard)
|
||||
end
|
||||
rescue => e
|
||||
rescue e
|
||||
puts "#{I18n.t('display.error')} #14: #{e}".red
|
||||
end
|
||||
|
||||
|
@ -578,7 +577,7 @@ module MPW
|
|||
File.open(file, 'w') { |f| f << data.to_yaml }
|
||||
|
||||
puts I18n.t('form.export.valid', file: file).to_s.green
|
||||
rescue => e
|
||||
rescue e
|
||||
puts "#{I18n.t('display.error')} #17: #{e}".red
|
||||
end
|
||||
|
||||
|
@ -613,7 +612,7 @@ module MPW
|
|||
@mpw.write_data
|
||||
|
||||
puts I18n.t('form.import.valid').to_s.green
|
||||
rescue => e
|
||||
rescue e
|
||||
puts "#{I18n.t('display.error')} #18: #{e}".red
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
# MPW is a software to crypt and manage your passwords
|
||||
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
||||
#
|
||||
|
@ -39,9 +38,9 @@ module MPW
|
|||
def initialize(config_file = nil)
|
||||
@config_file = config_file
|
||||
@config_dir =
|
||||
if /darwin/ =~ RUBY_PLATFORM
|
||||
if RUBY_PLATFORM =~ /darwin/
|
||||
"#{Dir.home}/Library/Preferences/mpw"
|
||||
elsif /cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM
|
||||
elsif RUBY_PLATFORM =~ /cygwin|mswin|mingw|bccwin|wince|emx/
|
||||
"#{Dir.home}/AppData/Local/mpw"
|
||||
else
|
||||
"#{Dir.home}/.config/mpw"
|
||||
|
@ -94,7 +93,7 @@ module MPW
|
|||
File.open(@config_file, 'w') do |file|
|
||||
file << config.to_yaml
|
||||
end
|
||||
rescue => e
|
||||
rescue e
|
||||
raise "#{I18n.t('error.config.write')}\n#{e}"
|
||||
end
|
||||
|
||||
|
@ -122,7 +121,7 @@ module MPW
|
|||
|
||||
ctx = GPGME::Ctx.new
|
||||
ctx.genkey(param, nil, nil)
|
||||
rescue => e
|
||||
rescue e
|
||||
raise "#{I18n.t('error.config.genkey_gpg.exception')}\n#{e}"
|
||||
end
|
||||
|
||||
|
@ -141,7 +140,7 @@ module MPW
|
|||
raise if @gpg_key.empty? || @wallet_dir.empty?
|
||||
|
||||
I18n.locale = @lang.to_sym
|
||||
rescue => e
|
||||
rescue e
|
||||
raise "#{I18n.t('error.config.load')}\n#{e}"
|
||||
end
|
||||
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
# MPW is a software to crypt and manage your passwords
|
||||
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
||||
#
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
# MPW is a software to crypt and manage your passwords
|
||||
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
||||
#
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
# MPW is a software to crypt and manage your passwords
|
||||
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
||||
#
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
# MPW is a software to crypt and manage your passwords
|
||||
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
||||
#
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
# MPW is a software to crypt and manage your passwords
|
||||
# Copyright (C) 2017 Adrien Waksberg <mpw@yae.im>
|
||||
#
|
||||
|
@ -89,14 +88,14 @@ module MPW
|
|||
otp: @otp_keys.key?(d['id']),
|
||||
comment: d['comment'],
|
||||
last_edit: d['last_edit'],
|
||||
created: d['created'],
|
||||
created: d['created']
|
||||
)
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
add_key(@key) unless @keys.key?(@key)
|
||||
rescue => e
|
||||
rescue e
|
||||
raise "#{I18n.t('error.mpw_file.read_data')}\n#{e}"
|
||||
end
|
||||
|
||||
|
@ -116,7 +115,7 @@ module MPW
|
|||
'url' => item.url,
|
||||
'comment' => item.comment,
|
||||
'last_edit' => item.last_edit,
|
||||
'created' => item.created,
|
||||
'created' => item.created
|
||||
}
|
||||
)
|
||||
end
|
||||
|
@ -147,7 +146,7 @@ module MPW
|
|||
end
|
||||
|
||||
File.rename(tmp_file, @wallet_file)
|
||||
rescue => e
|
||||
rescue e
|
||||
File.unlink(tmp_file) if File.exist?(tmp_file)
|
||||
|
||||
raise "#{I18n.t('error.mpw_file.write_data')}\n#{e}"
|
||||
|
@ -324,7 +323,7 @@ module MPW
|
|||
crypto
|
||||
.decrypt(data, password)
|
||||
.read.force_encoding('utf-8')
|
||||
rescue => e
|
||||
rescue e
|
||||
raise "#{I18n.t('error.gpg_file.decrypt')}\n#{e}"
|
||||
end
|
||||
|
||||
|
@ -342,7 +341,7 @@ module MPW
|
|||
end
|
||||
|
||||
crypto.encrypt(data, recipients: recipients).read
|
||||
rescue => e
|
||||
rescue e
|
||||
raise "#{I18n.t('error.gpg_file.encrypt')}\n#{e}"
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
# coding: utf-8
|
||||
|
||||
lib = File.expand_path('../lib', __FILE__)
|
||||
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
|
||||
require 'fileutils'
|
||||
require 'gpgme'
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
|
||||
require 'i18n'
|
||||
require 'test/unit'
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
|
||||
require 'mpw/config'
|
||||
require 'test/unit'
|
||||
require 'locale'
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
|
||||
require 'i18n'
|
||||
require 'test/unit'
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
|
||||
require 'mpw/item'
|
||||
require 'test/unit'
|
||||
require 'yaml'
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
|
||||
require 'mpw/mpw'
|
||||
require 'mpw/item'
|
||||
require 'test/unit'
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
#!/usr/bin/ruby
|
||||
|
||||
require 'yaml'
|
||||
require 'test/unit'
|
||||
|
||||
|
|
Loading…
Reference in a new issue