diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index f3f52c4..5d57aaa 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -69,8 +69,10 @@ jobs: timeout-minutes: 5 run: bundle exec bake test - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + include-hidden-files: true + if-no-files-found: error name: coverage-${{matrix.os}}-${{matrix.ruby}} path: .covered.db @@ -85,7 +87,7 @@ jobs: ruby-version: "3.3" bundler-cache: true - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 - name: Validate coverage timeout-minutes: 5 diff --git a/.rubocop.yml b/.rubocop.yml index 442c667..3b8d476 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -16,6 +16,9 @@ Layout/IndentationConsistency: Enabled: true EnforcedStyle: normal +Layout/BlockAlignment: + Enabled: true + Layout/EndAlignment: Enabled: true EnforcedStyleAlignWith: start_of_line @@ -44,3 +47,7 @@ Layout/EmptyLinesAroundModuleBody: Style/FrozenStringLiteralComment: Enabled: true + +Style/StringLiterals: + Enabled: true + EnforcedStyle: double_quotes diff --git a/config/sus.rb b/config/sus.rb index 7cfb58c..b4475c4 100644 --- a/config/sus.rb +++ b/config/sus.rb @@ -3,14 +3,14 @@ # Released under the MIT License. # Copyright, 2021-2024, by Samuel Williams. -require 'covered/sus' +require "covered/sus" include Covered::Sus Bundler.require(:adapters) ::CREDENTIALS = { - username: 'test', - password: 'test', - database: 'test', - host: '127.0.0.1' + username: "test", + password: "test", + database: "test", + host: "127.0.0.1" } diff --git a/db-migrate.gemspec b/db-migrate.gemspec index 60c381b..532e21b 100644 --- a/db-migrate.gemspec +++ b/db-migrate.gemspec @@ -10,17 +10,18 @@ Gem::Specification.new do |spec| spec.authors = ["Samuel Williams"] spec.license = "MIT" - spec.cert_chain = ['release.cert'] - spec.signing_key = File.expand_path('~/.gem/release.pem') + spec.cert_chain = ["release.cert"] + spec.signing_key = File.expand_path("~/.gem/release.pem") spec.homepage = "https://github.com/socketry/db-migrate" spec.metadata = { + "documentation_uri" => "https://socketry.github.io/db-migrate/", "funding_uri" => "https://github.com/sponsors/ioquatix/", "source_code_uri" => "https://github.com/socketry/db-migrate.git", } - spec.files = Dir.glob(['{lib}/**/*', '*.md'], File::FNM_DOTMATCH, base: __dir__) + spec.files = Dir.glob(["{lib}/**/*", "*.md"], File::FNM_DOTMATCH, base: __dir__) spec.required_ruby_version = ">= 3.1" diff --git a/fixtures/db/migrate/client_context.rb b/fixtures/db/migrate/client_context.rb index ab59e09..6ca8488 100644 --- a/fixtures/db/migrate/client_context.rb +++ b/fixtures/db/migrate/client_context.rb @@ -3,11 +3,11 @@ # Released under the MIT License. # Copyright, 2024, by Samuel Williams. -require 'db/client' -require 'db/adapters' -require 'db/migrate' +require "db/client" +require "db/adapters" +require "db/migrate" -require 'sus/fixtures/async' +require "sus/fixtures/async" module DB module Migrate diff --git a/lib/db/migrate.rb b/lib/db/migrate.rb index 89fd17c..fb7d323 100644 --- a/lib/db/migrate.rb +++ b/lib/db/migrate.rb @@ -3,6 +3,6 @@ # Released under the MIT License. # Copyright, 2021-2024, by Samuel Williams. -require_relative 'migrate/version' -require_relative 'migrate/migration' -require_relative 'migrate/information_schema' +require_relative "migrate/version" +require_relative "migrate/migration" +require_relative "migrate/information_schema" diff --git a/lib/db/migrate/create_index.rb b/lib/db/migrate/create_index.rb index b070d23..d039c60 100644 --- a/lib/db/migrate/create_index.rb +++ b/lib/db/migrate/create_index.rb @@ -3,7 +3,7 @@ # Released under the MIT License. # Copyright, 2021-2024, by Samuel Williams. -require_relative 'drop_index' +require_relative "drop_index" module DB module Migrate diff --git a/lib/db/migrate/create_table.rb b/lib/db/migrate/create_table.rb index a9d9171..e3257fe 100644 --- a/lib/db/migrate/create_table.rb +++ b/lib/db/migrate/create_table.rb @@ -3,8 +3,8 @@ # Released under the MIT License. # Copyright, 2021-2024, by Samuel Williams. -require_relative 'create_index' -require_relative 'drop_table' +require_relative "create_index" +require_relative "drop_table" module DB module Migrate diff --git a/lib/db/migrate/drop_table.rb b/lib/db/migrate/drop_table.rb index 4b8e9bd..0543ade 100644 --- a/lib/db/migrate/drop_table.rb +++ b/lib/db/migrate/drop_table.rb @@ -3,7 +3,7 @@ # Released under the MIT License. # Copyright, 2021-2024, by Samuel Williams. -require_relative 'create_index' +require_relative "create_index" module DB module Migrate diff --git a/lib/db/migrate/migration.rb b/lib/db/migrate/migration.rb index e742017..e002790 100644 --- a/lib/db/migrate/migration.rb +++ b/lib/db/migrate/migration.rb @@ -3,11 +3,11 @@ # Released under the MIT License. # Copyright, 2021-2024, by Samuel Williams. -require 'async' +require "async" -require_relative 'create_table' -require_relative 'rename_table' -require_relative 'create_index' +require_relative "create_table" +require_relative "rename_table" +require_relative "create_index" module DB module Migrate @@ -20,7 +20,7 @@ def initialize(name, session) def call(&block) create_table?(:migration) do primary_key - column :name, 'TEXT NOT NULL', unique: true, index: true + column :name, "TEXT NOT NULL", unique: true, index: true timestamps end diff --git a/lib/db/migrate/rename_table.rb b/lib/db/migrate/rename_table.rb index c10798b..84e64ff 100644 --- a/lib/db/migrate/rename_table.rb +++ b/lib/db/migrate/rename_table.rb @@ -3,7 +3,7 @@ # Released under the MIT License. # Copyright, 2021-2024, by Samuel Williams. -require_relative 'drop_index' +require_relative "drop_index" module DB module Migrate diff --git a/test/db/migrate.rb b/test/db/migrate.rb index 13fb638..82d5a53 100644 --- a/test/db/migrate.rb +++ b/test/db/migrate.rb @@ -1,9 +1,9 @@ # frozen_string_literal: true # Released under the MIT License. -# Copyright, 2021-2024, by Samuel Williams. +# Copyright, 2024, by Samuel Williams. -require 'db/migrate' +require "db/migrate" describe DB::Migrate do it "has a version number" do diff --git a/test/db/migrate/create_table.rb b/test/db/migrate/create_table.rb index 33bec8e..b383545 100644 --- a/test/db/migrate/create_table.rb +++ b/test/db/migrate/create_table.rb @@ -3,7 +3,7 @@ # Released under the MIT License. # Copyright, 2021-2024, by Samuel Williams. -require 'db/migrate/client_context' +require "db/migrate/client_context" describe DB::Migrate::CreateTable do DB::Adapters.each do |name, klass| @@ -14,8 +14,8 @@ DB::Migrate.migrate(self, client) do create_table :user, drop_if_exists: true do primary_key - column :name, 'TEXT', null: false - column :password, 'TEXT', null: false + column :name, "TEXT", null: false + column :password, "TEXT", null: false timestamps end end diff --git a/test/db/migrate/information_schema.rb b/test/db/migrate/information_schema.rb index 10f6b7f..fcd7781 100644 --- a/test/db/migrate/information_schema.rb +++ b/test/db/migrate/information_schema.rb @@ -3,14 +3,14 @@ # Released under the MIT License. # Copyright, 2021-2024, by Samuel Williams. -require 'db/migrate/client_context' +require "db/migrate/client_context" describe DB::Migrate::InformationSchema do DB::Adapters.each do |name, klass| describe klass, unique: name do include_context DB::Migrate::ClientContext, klass.new(**CREDENTIALS) - with 'table_exist?' do + with "table_exist?" do it "can confirm table does not exist" do client.session do |session| information_schema = DB::Migrate::InformationSchema.new(session) diff --git a/test/db/migrate/rename_table.rb b/test/db/migrate/rename_table.rb index d68e01f..4fab73a 100644 --- a/test/db/migrate/rename_table.rb +++ b/test/db/migrate/rename_table.rb @@ -3,7 +3,7 @@ # Released under the MIT License. # Copyright, 2021-2024, by Samuel Williams. -require 'db/migrate/client_context' +require "db/migrate/client_context" describe DB::Migrate::CreateTable do DB::Adapters.each do |name, klass|