From 9e435511e8408583115928f4ae7acffc01f39fb0 Mon Sep 17 00:00:00 2001 From: Dan Webb Date: Mon, 27 Nov 2023 11:34:48 +0000 Subject: [PATCH] feat: workflows and renovate (#116) - Configure Renovate - Pin lint-unit workflow to v0.1.1 - Configure Rubocop to use Chefstyle Signed-off-by: Dan Webb --- .github/workflows/lint.yml | 9 +++++++++ .github/workflows/linters.yml | 9 --------- .markdownlint.yaml | 7 +++++-- .rubocop.yml | 37 ++++++++++------------------------- Gemfile | 12 ++++++++++-- kitchen-digitalocean.gemspec | 17 +++------------- renovate.json | 8 ++++++++ spec/spec_helper.rb | 10 ---------- 8 files changed, 45 insertions(+), 64 deletions(-) create mode 100644 .github/workflows/lint.yml delete mode 100644 .github/workflows/linters.yml create mode 100644 renovate.json diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..6d67455 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,9 @@ +--- +name: "Test" + +"on": + pull_request: + +jobs: + lint-unit: + uses: test-kitchen/.github/.github/workflows/lint-unit.yml@v0.1.1 diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml deleted file mode 100644 index 4700f36..0000000 --- a/.github/workflows/linters.yml +++ /dev/null @@ -1,9 +0,0 @@ ---- -name: 'Test' - -'on': - pull_request: - -jobs: - lint-unit: - uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 177bd51..5df560a 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,5 +1,8 @@ ---- -MD012: false +default: true MD013: false MD024: false +MD026: false MD036: false +MD012: false +MD029: false +MD004: false diff --git a/.rubocop.yml b/.rubocop.yml index 3dbf20e..46802c5 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,27 +1,10 @@ ---- -Documentation: - Enabled: false - -Semicolon: - Enabled: false - -Metrics/MethodLength: - Enabled: false - -Metrics/AbcSize: - Enabled: false - -Metrics/BlockLength: - Enabled: false - -Metrics/PerceivedComplexity: - Enabled: false - -Metrics/CyclomaticComplexity: - Enabled: false - -Metrics/LineLength: - Enabled: false - -Metrics/ClassLength: - Enabled: false +require: + - chefstyle + +AllCops: + TargetRubyVersion: 3.1 + Include: + - "**/*.rb" + Exclude: + - "vendor/**/*" + - "spec/**/*" diff --git a/Gemfile b/Gemfile index c8abf9b..80d5095 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,14 @@ source "https://rubygems.org" -# Specify your gem's dependencies in kitchen-digitalocean.gemspec gemspec -# vim: ai et ts=2 sts=2 sw=2 ft=ruby +group :test do + gem 'bundler' + gem 'rake' + gem 'rspec', '~> 3.2' + gem "webmock", "~> 3.5" +end + +group :chefstyle do + gem "chefstyle", "2.2.3" +end diff --git a/kitchen-digitalocean.gemspec b/kitchen-digitalocean.gemspec index 4a6ffea..472c81a 100644 --- a/kitchen-digitalocean.gemspec +++ b/kitchen-digitalocean.gemspec @@ -5,8 +5,8 @@ require "kitchen/driver/digitalocean_version" Gem::Specification.new do |spec| spec.name = "kitchen-digitalocean" spec.version = Kitchen::Driver::DIGITALOCEAN_VERSION - spec.authors = ["Greg Fitzgerald"] - spec.email = ["greg@gregf.org"] + spec.authors = ["Test Kitchen Team"] + spec.email = ["help@sous-chefs.org"] spec.description = "A Test Kitchen Driver for Digital Ocean" spec.summary = spec.description spec.homepage = "https://github.com/test-kitchen/kitchen-digitalocean" @@ -15,19 +15,8 @@ Gem::Specification.new do |spec| spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR).grep(/LICENSE|^lib/) spec.require_paths = ["lib"] - spec.required_ruby_version = ">= 2.7" + spec.required_ruby_version = ">= 3.0" spec.add_dependency "droplet_kit", ">= 3.7", "< 4.0" spec.add_dependency "test-kitchen", ">= 1.17", "< 4" - - spec.add_development_dependency "countloc", "~> 0.4" - spec.add_development_dependency "coveralls", "~> 0.8" - spec.add_development_dependency "rake" - spec.add_development_dependency "rspec", "~> 3.8" - spec.add_development_dependency "chefstyle", "= 2.2.3" - spec.add_development_dependency "simplecov", "~> 0.9" - spec.add_development_dependency "simplecov-console", "~> 0.2" - spec.add_development_dependency "webmock", "~> 3.5" end - -# vim: ai et ts=2 sts=2 sw=2 ft=ruby diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..b65764b --- /dev/null +++ b/renovate.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended", + ":disableDependencyDashboard", + "schedule:automergeEarlyMondays" + ] +} diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e1558f6..63cee13 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -17,16 +17,6 @@ require "rspec" require "webmock/rspec" -require "simplecov" -require "simplecov-console" -require "coveralls" - -SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([ - Coveralls::SimpleCov::Formatter, - SimpleCov::Formatter::HTMLFormatter, - SimpleCov::Formatter::Console, - ]) -SimpleCov.start WebMock.disable_net_connect!(allow_localhost: true)