diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 2bb95e89..d6c93216 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 1.13.5 +current_version = 1.15.0 tag = true commit = true diff --git a/.rubocop.yml b/.rubocop.yml index 7b89d350..fb2b9918 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,6 +1,10 @@ inherit_from: .rubocop_todo.yml -Style/FileName: +AllCops: + NewCops: enable + SuggestExtensions: false + +Naming/FileName: Exclude: - 'lib/vagrant-vsphere.rb' @@ -21,7 +25,7 @@ Metrics/ClassLength: Metrics/CyclomaticComplexity: Enabled: false -Metrics/LineLength: +Layout/LineLength: Enabled: false Metrics/MethodLength: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 2f92dbab..e7d3b44a 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,60 +1,370 @@ -# This configuration was generated by `rubocop --auto-gen-config` -# on 2016-03-08 12:12:34 -0700 using RuboCop version 0.32.1. +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2026-08-05 22:25:30 UTC using RuboCop version 1.89.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: 1 +# This cop supports safe autocorrection (--autocorrect). +Gemspec/DeprecatedAttributeAssignment: + Exclude: + - 'vSphere.gemspec' + +# Offense count: 5 +# Configuration parameters: EnforcedStyle, AllowedGems. +# SupportedStyles: Gemfile, gems.rb, gemspec +Gemspec/DevelopmentDependencies: + Exclude: + - 'vSphere.gemspec' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Gemspec/RequireMFA: + Exclude: + - 'vSphere.gemspec' + +# Offense count: 1 +Gemspec/RequiredRubyVersion: + Exclude: + - 'vSphere.gemspec' + +# Offense count: 10 +# This cop supports safe autocorrection (--autocorrect). +Layout/EmptyLineAfterGuardClause: + Exclude: + - 'lib/vSphere/action/clone.rb' + - 'lib/vSphere/action/destroy.rb' + - 'lib/vSphere/action/get_ssh_info.rb' + - 'lib/vSphere/cap/public_address.rb' + - 'lib/vSphere/provider.rb' + - 'lib/vSphere/util/vim_helpers.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: empty_lines, no_empty_lines +Layout/EmptyLinesAroundBlockBody: + Exclude: + - 'spec/get_ssh_info_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowForAlignment, AllowBeforeTrailingComments, ForceEqualSignAlignment. +Layout/ExtraSpacing: + Exclude: + - 'lib/vSphere/action/get_state.rb' + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses +Layout/FirstArgumentIndentation: + Exclude: + - 'lib/vSphere/action/snapshot_delete.rb' + - 'lib/vSphere/action/snapshot_restore.rb' + - 'lib/vSphere/action/snapshot_save.rb' + - 'spec/spec_helper.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: IndentationWidth. +# SupportedStyles: special_inside_parentheses, consistent, align_brackets +Layout/FirstArrayElementIndentation: + EnforcedStyle: consistent + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# 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: + - 'spec/clone_spec.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: symmetrical, new_line, same_line +Layout/MultilineArrayBraceLayout: + Exclude: + - 'spec/get_ssh_info_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: symmetrical, new_line, same_line +Layout/MultilineHashBraceLayout: + Exclude: + - 'spec/clone_spec.rb' + +# Offense count: 16 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: symmetrical, new_line, same_line +Layout/MultilineMethodCallBraceLayout: + Exclude: + - 'lib/vSphere/action/snapshot_delete.rb' + - 'lib/vSphere/action/snapshot_restore.rb' + - 'lib/vSphere/action/snapshot_save.rb' + - 'lib/vSphere/util/vm_helpers.rb' + - 'spec/clone_spec.rb' + - 'spec/get_ssh_info_spec.rb' + - 'spec/spec_helper.rb' + +# Offense count: 1 +# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches, IgnoreDuplicateElseBranch. +Lint/DuplicateBranch: + Exclude: + - 'lib/vSphere/util/vim_helpers.rb' + +# Offense count: 2 +# Configuration parameters: AllowedParentClasses. +Lint/MissingSuper: + Exclude: + - 'lib/vSphere/config.rb' + - 'lib/vSphere/provider.rb' + # Offense count: 1 Lint/NonLocalExitFromIterator: - Enabled: false + Exclude: + - 'lib/vSphere/util/vim_helpers.rb' -# Offense count: 24 -Style/Documentation: - Enabled: false +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: strict, consistent +Lint/SymbolConversion: + Exclude: + - 'lib/vSphere/action/clone.rb' + - 'lib/vSphere/action/get_ssh_info.rb' + +# Offense count: 9 +# Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns. +# AllowedMethods: refine +Metrics/BlockLength: + Max: 168 + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). +Migration/DepartmentName: + Exclude: + - 'lib/vSphere/action.rb' + - 'lib/vSphere/plugin.rb' + +# Offense count: 1 +# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. +Naming/BlockParameterName: + Exclude: + - 'spec/spec_helper.rb' + +# Offense count: 1 +# Configuration parameters: EnforcedStyle, AllowedPatterns, ForbiddenIdentifiers, ForbiddenPatterns. +# SupportedStyles: snake_case, camelCase +# ForbiddenIdentifiers: __id__, __send__ +Naming/MethodName: + Exclude: + - 'lib/vSphere/config.rb' + +# Offense count: 20 +# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. +# AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to +Naming/MethodParameterName: + Exclude: + - 'lib/vSphere/action/clone.rb' + - 'lib/vSphere/action/get_ssh_info.rb' + - 'lib/vSphere/util/vim_helpers.rb' + - 'lib/vSphere/util/vm_helpers.rb' # Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/EmptyLinesAroundBlockBody: - Enabled: false +# Configuration parameters: EnforcedStyle, AllowedIdentifiers, AllowedPatterns, ForbiddenIdentifiers, ForbiddenPatterns. +# SupportedStyles: snake_case, camelCase +Naming/VariableName: + Exclude: + - 'lib/vSphere/action/clone.rb' + - 'spec/spec_helper.rb' + +# Offense count: 28 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: separated, grouped +Style/AccessorGrouping: + Exclude: + - 'lib/vSphere/config.rb' # Offense count: 1 -# Cop supports --auto-correct. -Style/EmptyLiteral: +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: MinBranchesCount. +Style/CaseLikeIf: + Exclude: + - 'lib/vSphere/util/vim_helpers.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/CommentedKeyword: + Exclude: + - 'lib/vSphere/action.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. +# SupportedStyles: assign_to_condition, assign_inside_condition +Style/ConditionalAssignment: + Exclude: + - 'lib/vSphere/util/vm_helpers.rb' + +# Offense count: 32 +# Configuration parameters: AllowedConstants. +Style/Documentation: Enabled: false # Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. -Style/FirstParameterIndentation: +# This cop supports safe autocorrection (--autocorrect). +Style/EmptyLiteral: + Exclude: + - 'spec/clone_spec.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +Style/ExpandPathArguments: + Exclude: + - 'Rakefile' + - 'lib/vSphere/action.rb' + - 'lib/vagrant-vsphere.rb' + +# Offense count: 43 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: always, always_true, never +Style/FrozenStringLiteralComment: Enabled: false -# Offense count: 6 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, UseHashRocketsWithSymbolValues. +# Offense count: 7 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols. +# SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys +# SupportedShorthandSyntax: always, never, either, consistent, either_consistent Style/HashSyntax: - Enabled: false + Exclude: + - 'lib/vSphere/action/clone.rb' + - 'spec/spec_helper.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +Style/IfUnlessModifier: + Exclude: + - 'lib/vSphere/action/clone.rb' + - 'lib/vSphere/config.rb' + - 'lib/vSphere/plugin.rb' + +# Offense count: 11 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle, Recursive. +# SupportedStyles: literals, strict +Style/MutableConstant: + Exclude: + - 'lib/vSphere/util/vm_helpers.rb' + - 'lib/vSphere/version.rb' + - 'spec/clone_spec.rb' + - 'spec/spec_helper.rb' + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle, AllowedMethods, AllowedPatterns. +# SupportedStyles: predicate, comparison +Style/NumericPredicate: + Exclude: + - 'spec/**/*' + - 'lib/vSphere/action/clone.rb' + - 'lib/vSphere/action/get_ssh_info.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: PreferredDelimiters. +Style/PercentLiteralDelimiters: + Exclude: + - 'Rakefile' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantBegin: + Exclude: + - 'lib/vSphere/action/clone.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantParentheses: + Exclude: + - 'lib/vSphere/action/get_ssh_info.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantRegexpEscape: + Exclude: + - 'lib/vSphere/action/clone.rb' # Offense count: 2 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes. +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, AllowInnerSlashes. +# SupportedStyles: slashes, percent_r, mixed Style/RegexpLiteral: - Enabled: false + Exclude: + - 'vSphere.gemspec' -# Offense count: 3 -# Cop supports --auto-correct. -# Configuration parameters: MultiSpaceAllowedForOperators. -Style/SpaceAroundOperators: - Enabled: false +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: implicit, explicit +Style/RescueStandardError: + Exclude: + - 'lib/vSphere/action/clone.rb' + +# Offense count: 22 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: only_raise, only_fail, semantic +Style/SignalException: + Exclude: + - 'lib/vSphere/action/clone.rb' + - 'lib/vSphere/action/get_ssh_info.rb' + - 'lib/vSphere/plugin.rb' + - 'lib/vSphere/util/vim_helpers.rb' # Offense count: 1 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, SupportedStyles. +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: Mode. +Style/StringConcatenation: + Exclude: + - 'lib/vSphere/util/vim_helpers.rb' + +# Offense count: 5 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline. +# SupportedStyles: single_quotes, double_quotes Style/StringLiterals: - Enabled: false + Exclude: + - 'lib/vSphere/action/snapshot_delete.rb' + - 'lib/vSphere/action/snapshot_restore.rb' + - 'lib/vSphere/action/snapshot_save.rb' -# Offense count: 4 -# Cop supports --auto-correct. +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: MinSize. +# SupportedStyles: percent, brackets +Style/SymbolArray: + EnforcedStyle: brackets + +# Offense count: 6 +# This cop supports safe autocorrection (--autocorrect). Style/SymbolLiteral: - Enabled: false + Exclude: + - 'lib/vSphere/action/clone.rb' + - 'lib/vSphere/action/get_ssh_info.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/ZeroLengthPredicate: + Exclude: + - 'lib/vSphere/action/clone.rb' diff --git a/.ruby-version b/.ruby-version index 57cf282e..7ac59058 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.6.5 +ruby-3.4.10 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index aecbecac..358fbd6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,15 @@ +## [1.15.0 (TBD)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.15.0) + - Update gem to Ruby 3.4.10 + - Support for Vagrant >=2.4.9 + - Upgrade nokogiri to ~> 1.19.4 + - update other dependencies + +## [1.14.0 (2022-08-01)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.14.0) + - Update gem to Ruby 3.0.2 + - Support for Vagrant >=2.2.17 + - Upgrade nokogiri to 1.13.4 + - Update other dependencies + ## [1.13.5 (2021-01-05)](https://github.com/nsidc/vagrant-vsphere/releases/tag/v1.13.5) - Pin nokogiri to 1.10.10. This fixes an issue where vagrant-vsphere failed to install due to nokogiri requiring Ruby >=2.5. This is a workaround until the vagrant-nsidc plugin is updated diff --git a/Gemfile b/Gemfile index 9b41f7d2..bf7ae7f8 100644 --- a/Gemfile +++ b/Gemfile @@ -1,10 +1,13 @@ +# frozen_string_literal: true + source 'http://rubygems.org' group :development do + gem 'pry-byebug', '~> 3.12.0' # We depend on Vagrant for development, but we don't add it as a # gem dependency because we expect to be installed within the # Vagrant environment itself using `vagrant plugin`. - gem 'vagrant', github: 'mitchellh/vagrant', ref: 'v2.2.6' + gem 'vagrant', git: 'https://github.com/mitchellh/vagrant.git', ref: 'v2.4.9' end group :plugins do diff --git a/README.md b/README.md index 7af5b645..862a9707 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,9 @@ nsidc@nsidc.org for more information. ## Current Version -**version: 1.13.5** +**version: 1.15.0** -vagrant-vsphere (**version: 1.13.5**) is available from +vagrant-vsphere (**version: 1.15.0**) is available from [RubyGems.org](https://rubygems.org/gems/vagrant-vsphere) diff --git a/lib/vSphere/version.rb b/lib/vSphere/version.rb index 295c58a3..6933b8cf 100644 --- a/lib/vSphere/version.rb +++ b/lib/vSphere/version.rb @@ -1,5 +1,5 @@ module VagrantPlugins module VSphere - VERSION = '1.13.5' + VERSION = '1.15.0' end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b0d9d188..08b531e4 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -78,7 +78,8 @@ def call networks: [[:private_network, { ip: '0.0.0.0' }]], boot_timeout: 1, graceful_halt_timeout: 0.1, - guest: nil), + guest: nil, + allow_hosts_modification: nil), validate: [] ) @app = double 'app', call: true @@ -92,7 +93,8 @@ def call :id => nil, :id= => nil, :name => nil, - :guest => double('guest', capability: nil) + :guest => double('guest', capability: nil, capability?: nil), + :triggers => nil @env = { machine: @machine, diff --git a/vSphere.gemspec b/vSphere.gemspec index 355d6f39..9555a8f6 100644 --- a/vSphere.gemspec +++ b/vSphere.gemspec @@ -1,4 +1,6 @@ -$LOAD_PATH.unshift File.expand_path('../lib', __FILE__) +# frozen_string_literal: true + +$LOAD_PATH.unshift File.expand_path('lib', __dir__) require 'vSphere/version' Gem::Specification.new do |s| @@ -12,17 +14,17 @@ Gem::Specification.new do |s| s.description = 'Enables Vagrant to manage machines with VMWare vSphere.' # pin nokogiri to 1.10.10 to get around 1.11.0 requiring ruby >=2.5 - s.add_dependency 'nokogiri', '1.10.10' + s.add_dependency 'nokogiri', '~> 1.19.4' - s.add_dependency 'rbvmomi', '>=1.11.5', '<2.0.0' + s.add_dependency 'rbvmomi', '~> 3.0.0' s.add_dependency 'i18n', '>=0.6.4' - s.add_development_dependency 'rake', '11.1.2' # pinned to accommodate rubocop 0.32.1 + s.add_development_dependency 'rake', '~> 13.4.2' # pinned to accommodate rubocop 0.32.1 s.add_development_dependency 'rspec-core' s.add_development_dependency 'rspec-expectations' s.add_development_dependency 'rspec-mocks' - s.add_development_dependency 'rubocop', '~> 0.32.1' + s.add_development_dependency 'rubocop', '~> 1.89.0' s.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR) s.executables = s.files.grep(/^bin\//) { |f| File.basename(f) }