Skip to content

Commit

Permalink
Enable Gemspec/RequireMFA and Style/FetchEnvVar cops
Browse files Browse the repository at this point in the history
Because `.rubocop.yml` is set to `NewCops: enable`, these newly added cops
detect offenses when Rake Task is running.

* rubocop/rubocop#10243
* rubocop/rubocop#10502
  • Loading branch information
osanay committed May 25, 2022
1 parent de06647 commit 0485ecd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions armg.gemspec
Expand Up @@ -14,6 +14,7 @@ Gem::Specification.new do |spec|
spec.description = 'Add MySQL geometry type to Active Record.'
spec.homepage = 'https://github.com/winebarrel/armg'
spec.license = 'MIT'
spec.metadata = { 'rubygems_mfa_required' => 'true' }

spec.files = `git ls-files -z`.split("\x0").reject do |f|
f.match(%r{^(test|spec|features)/})
Expand Down
10 changes: 5 additions & 5 deletions spec/mysql_helper.rb
@@ -1,11 +1,11 @@
# frozen_string_literal: true

class MysqlHelper
MYSQL_HOST = ENV['ARMG_TEST_MYSQL_HOST'] || '127.0.0.1'
MYSQL_PORT = ENV['ARMG_TEST_MYSQL_PORT'] || 10_056
MYSQL_USER = ENV['ARMG_TEST_MYSQL_USER'] || 'root'
MYSQL_DB = ENV['ARMG_TEST_MYSQL_DB'] || 'armg_test'
MYSQL_ENGINE = ENV['ARMG_TEST_MYSQL_ENGINE'] || 'MyISAM'
MYSQL_HOST = ENV.fetch('ARMG_TEST_MYSQL_HOST', '127.0.0.1')
MYSQL_PORT = ENV.fetch('ARMG_TEST_MYSQL_PORT', 10_056)
MYSQL_USER = ENV.fetch('ARMG_TEST_MYSQL_USER', 'root')
MYSQL_DB = ENV.fetch('ARMG_TEST_MYSQL_DB', 'armg_test')
MYSQL_ENGINE = ENV.fetch('ARMG_TEST_MYSQL_ENGINE', 'MyISAM')
TABLE_OPTIONS = if ActiveRecord.gem_version < Gem::Version.new('6.1.0')
"ENGINE=#{MYSQL_ENGINE} DEFAULT CHARSET=utf8"
elsif MYSQL_ENGINE == 'InnoDB'
Expand Down

0 comments on commit 0485ecd

Please sign in to comment.