diff --git a/.rubocop.yml b/.rubocop.yml index 309d3e29..84fb5455 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,7 +1,7 @@ inherit_from: .rubocop_todo.yml AllCops: - TargetRubyVersion: 2.0 + TargetRubyVersion: 2.4 Exclude: - 'vendor/**/*' - 'tmp/**/*' @@ -25,3 +25,6 @@ Layout/IndentHeredoc: # sane line length Metrics/LineLength: Max: 120 + +Style/FrozenStringLiteralComment: + Enabled: false diff --git a/features/step_definitions/git_steps.rb b/features/step_definitions/git_steps.rb index d136b0be..36c1e903 100644 --- a/features/step_definitions/git_steps.rb +++ b/features/step_definitions/git_steps.rb @@ -16,11 +16,11 @@ - puppet-test """ ) - write_file('modulesync.yml', <<-CONFIG) ---- - namespace: sources - git_base: file://#{expand_path('.')}/ - CONFIG + write_file('modulesync.yml', <<~CONFIG) + --- + namespace: sources + git_base: file://#{expand_path('.')}/ + CONFIG end Given Regexp.new(/a remote module repository with "(.+?)" as the default branch/) do |branch| @@ -33,11 +33,12 @@ - puppet-test """ ) - write_file('modulesync.yml', <<-CONFIG) ---- - namespace: sources - git_base: file://#{expand_path('.')}/ - CONFIG + write_file('modulesync.yml', <<~CONFIG) + --- + namespace: sources + git_base: file://#{expand_path('.')}/ + CONFIG + cd('sources/puppet-test') do steps %( And I run `git branch -M master #{branch}` diff --git a/lib/modulesync/cli.rb b/lib/modulesync/cli.rb index 0db70006..72602219 100644 --- a/lib/modulesync/cli.rb +++ b/lib/modulesync/cli.rb @@ -36,15 +36,14 @@ def deactivate class Base < Thor class_option :project_root, :aliases => '-c', - :desc => 'Path used by git to clone modules into. Defaults to "modules"', + :desc => 'Path used by git to clone modules into.', :default => CLI.defaults[:project_root] || 'modules' class_option :git_base, :desc => 'Specify the base part of a git URL to pull from', :default => CLI.defaults[:git_base] || 'git@github.com:' class_option :namespace, :aliases => '-n', - :desc => 'Remote github namespace (user or organization) to clone from and push to.' \ - ' Defaults to puppetlabs', + :desc => 'Remote github namespace (user or organization) to clone from and push to.', :default => CLI.defaults[:namespace] || 'puppetlabs' class_option :filter, :aliases => '-f', diff --git a/lib/modulesync/git.rb b/lib/modulesync/git.rb index af47fc08..e6f70b69 100644 --- a/lib/modulesync/git.rb +++ b/lib/modulesync/git.rb @@ -150,7 +150,7 @@ def self.update(name, files, options) tag(repo, new, options[:tag_pattern]) if options[:tag] end rescue ::Git::GitExecuteError => git_error - if git_error.message =~ /working (directory|tree) clean/ + if git_error.message.match?(/working (directory|tree) clean/) puts "There were no files to update in #{name}. Not committing." return false else