From 5dc065ee9c486cdf842aea0d292647292b5e465b Mon Sep 17 00:00:00 2001 From: jordanbreen28 Date: Mon, 25 Sep 2023 12:02:30 +0100 Subject: [PATCH] test bump --- .github/workflows/ci.yml | 12 +++- .github/workflows/nightly.yml | 12 +++- .rubocop_todo.yml | 68 ++++++++++++++++++- Gemfile | 6 +- Rakefile | 2 +- .../puppetfile/validation_provider.rb | 4 +- .../server_capabilities.rb | 3 +- .../puppetfile/validation_provider_spec.rb | 6 +- vendor/README.md | 2 +- 9 files changed, 98 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 822ccf62..bfb32568 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,7 @@ jobs: matrix: ruby_version: - '2.7' + - '3.2' runs_on: - 'ubuntu-latest' - 'windows-latest' @@ -32,6 +33,7 @@ jobs: matrix: ruby_version: - '2.7' + - '3.2' runs_on: - 'ubuntu-latest' - 'windows-latest' @@ -46,13 +48,19 @@ jobs: puppet_version: '~> 7.24' build: - name: "Build Editor Service" + strategy: + fail-fast: false + matrix: + ruby_version: + - '2.7' + - '3.2' + name: "Build Editor Service (Ruby ${{ matrix.ruby_version }})" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: - ruby-version: '2.7' + ruby-version: ${{ matrix.ruby_version }} bundler-cache: true - name: Set build version shell: pwsh diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index bd26b1bd..85f17807 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -13,6 +13,7 @@ jobs: matrix: ruby_version: - '2.7' + - '3.2' runs_on: - 'ubuntu-latest' - 'windows-latest' @@ -31,6 +32,7 @@ jobs: matrix: ruby_version: - '2.7' + - '3.2' runs_on: - 'ubuntu-latest' - 'windows-latest' @@ -45,13 +47,19 @@ jobs: puppet_version: '~> 7.24' build: - name: "Build Editor Service" + strategy: + fail-fast: false + matrix: + ruby_version: + - '2.7' + - '3.2' + name: "Build Editor Service (Ruby ${{ matrix.ruby_version }})" runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: ruby/setup-ruby@v1 with: - ruby-version: '2.7' + ruby-version: ${{ matrix.ruby_version }} bundler-cache: true - name: Set build version shell: pwsh diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index b1cfe267..3bcfbf2a 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1 +1,67 @@ -# Empty \ No newline at end of file +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2023-09-25 11:19:34 UTC using RuboCop version 1.48.1. +# 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). +# Configuration parameters: AllowForAlignment, EnforcedStyleForExponentOperator. +# SupportedStylesForExponentOperator: space, no_space +Layout/SpaceAroundOperators: + Exclude: + - 'lib/puppet_editor_services/protocol/json_rpc.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowInHeredoc. +Layout/TrailingWhitespace: + Exclude: + - 'lib/puppet-languageserver/puppetfile/validation_provider.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: literals, strict +Style/MutableConstant: + Exclude: + - 'lib/puppet_editor_services/protocol/json_rpc.rb' + +# Offense count: 17 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantBegin: + Exclude: + - 'lib/dsp/dsp.rb' + - 'lib/lsp/lsp.rb' + - 'lib/puppet-debugserver/hooks.rb' + - 'lib/puppet-languageserver/global_queues/single_instance_queue.rb' + - 'lib/puppet-languageserver/manifest/validation_provider.rb' + - 'lib/puppet-languageserver/providers.rb' + - 'lib/puppet-languageserver/puppet_monkey_patches.rb' + - 'lib/puppet_debugserver.rb' + - 'lib/puppet_editor_services/server/tcp.rb' + - 'lib/puppet_languageserver.rb' + - 'lib/puppet_languageserver_sidecar.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantFreeze: + Exclude: + - 'lib/puppet-languageserver/puppet_lexer_helper.rb' + +# Offense count: 2 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/SlicingWithRange: + Exclude: + - 'lib/puppet-languageserver/manifest/hover_provider.rb' + - 'lib/puppet-languageserver/puppet_lexer_helper.rb' + +# Offense count: 3 +# This cop supports unsafe autocorrection (--autocorrect-all). +Style/ZeroLengthPredicate: + Exclude: + - 'lib/puppet-debugserver/debug_session/hook_handlers.rb' + - 'lib/puppet-languageserver/message_handler.rb' + - 'lib/puppet_editor_services/server/tcp.rb' diff --git a/Gemfile b/Gemfile index 6ae97cd0..f475e3e4 100644 --- a/Gemfile +++ b/Gemfile @@ -15,9 +15,9 @@ group :development do gem 'puppetfile-resolver', '~> 0.6.2', :require => false gem 'yard', '~> 0.9.28', :require => false - gem "rubocop", '= 1.6.1', require: false - gem "rubocop-performance", '= 1.9.1', require: false - gem "rubocop-rspec", '= 2.0.1', require: false + gem "rubocop", '~> 1.48.1', require: false + gem "rubocop-performance", '~> 1.16', require: false + gem "rubocop-rspec", '~> 2.19', require: false if ENV['PUPPET_GEM_VERSION'] gem 'puppet', ENV['PUPPET_GEM_VERSION'], :require => false diff --git a/Rakefile b/Rakefile index 0e53cbf1..3d56d85a 100644 --- a/Rakefile +++ b/Rakefile @@ -65,7 +65,7 @@ task :gem_revendor do { :directory => 'puppetfile-resolver', :github_repo => 'https://github.com/glennsarti/puppetfile-resolver.git', - :github_ref => '0.3.0', + :github_ref => '0.6.2', }, { :directory => 'molinillo', diff --git a/lib/puppet-languageserver/puppetfile/validation_provider.rb b/lib/puppet-languageserver/puppetfile/validation_provider.rb index d6e8ef5e..0f460839 100644 --- a/lib/puppet-languageserver/puppetfile/validation_provider.rb +++ b/lib/puppet-languageserver/puppetfile/validation_provider.rb @@ -43,7 +43,6 @@ def self.validate(content, options = {}) puppetfile.validation_errors.each do |validation_error| related_information = nil - if validation_error.is_a?(PuppetfileResolver::Puppetfile::DocumentDuplicateModuleError) related_information = validation_error.duplicates.map do |dup_mod| { @@ -87,7 +86,7 @@ def self.validate_resolution(puppetfile_document, document_uri, cache, module_pa 'message' => e.message )] end - + resolution.validation_errors.map do |error| severity = case error when PuppetfileResolver::Puppetfile::DocumentLatestVersionError @@ -160,7 +159,6 @@ def self.document_error_to_diagnostic(document_uri, error) 'message' => "Module definition for #{dup_mod.name}" } end - LSP::Diagnostic.new( 'severity' => LSP::DiagnosticSeverity::ERROR, 'range' => document_location_to_lsp_range(error.puppetfile_modules[0].location), diff --git a/lib/puppet-languageserver/server_capabilities.rb b/lib/puppet-languageserver/server_capabilities.rb index cdf0e73b..73c1fbab 100644 --- a/lib/puppet-languageserver/server_capabilities.rb +++ b/lib/puppet-languageserver/server_capabilities.rb @@ -42,8 +42,7 @@ def self.folding_range_provider_options def self.no_capabilities # Any empty hash denotes no capabilities at all - { - } + {} end end end diff --git a/spec/languageserver/unit/puppet-languageserver/puppetfile/validation_provider_spec.rb b/spec/languageserver/unit/puppet-languageserver/puppetfile/validation_provider_spec.rb index f6068fbd..4f07210b 100644 --- a/spec/languageserver/unit/puppet-languageserver/puppetfile/validation_provider_spec.rb +++ b/spec/languageserver/unit/puppet-languageserver/puppetfile/validation_provider_spec.rb @@ -88,6 +88,8 @@ def load(name) expect(lint_error.source).to eq('Puppet') expect(lint_error.message).to match('syntax error') expect(lint_error.range).to_not be_nil + expect(lint_error.range.start.line).to eq(12) + expect(lint_error.range.end.line).to eq(12) expect(lint_error.severity).to eq(LSP::DiagnosticSeverity::ERROR) end end @@ -108,6 +110,7 @@ def load(name) mod 'gittagmodule', :git => 'https://github.com/username/repo', :tag => '0.1' + EOT end @@ -146,7 +149,6 @@ def load(name) lint_error = subject.validate(content, validation_options) expect(lint_error.count).to eq(1) lint_error = lint_error[0] - expect(lint_error.source).to eq('Puppet') expect(lint_error.message).to match('A Mock Runtime Error') expect(lint_error.range.start.line).to eq(10) @@ -466,7 +468,7 @@ def load(name) :owner=>"puppetlabs", :start_line=>3, :title=>"puppetlabs-somemodule", - :version=>"1.0.0"}]) + :version=>"=1.0.0"}]) # this is now how versions are returned by puppetfile-resolver, see https://github.com/glennsarti/puppetfile-resolver/pull/16/files end end diff --git a/vendor/README.md b/vendor/README.md index a59dbf41..446da6ff 100644 --- a/vendor/README.md +++ b/vendor/README.md @@ -13,7 +13,7 @@ Gem List * puppet-lint (https://github.com/puppetlabs/puppet-lint.git ref v4.2.0) * hiera-eyaml (https://github.com/voxpupuli/hiera-eyaml ref v2.1.0) -* puppetfile-resolver (https://github.com/glennsarti/puppetfile-resolver.git ref 0.3.0) +* puppetfile-resolver (https://github.com/glennsarti/puppetfile-resolver.git ref 0.6.2) * molinillo (https://github.com/CocoaPods/Molinillo.git ref 0.6.6) * puppet-strings (https://github.com/puppetlabs/puppet-strings.git ref v4.1.0) * yard (https://github.com/lsegal/yard.git ref v0.9.24)