From e8e5fcc6f1b89c27497bc9c2cb5b77ea945baa5a Mon Sep 17 00:00:00 2001 From: Niklas van Schrick Date: Thu, 27 Feb 2025 20:30:59 +0100 Subject: [PATCH] Move rubocop code out of lib to fix autoloaded applications --- code0-zero_track.gemspec | 2 +- {lib/rubocop => rubocop}/code0/zero_track/file_helpers.rb | 0 .../cop/code0/zero_track/logs/rails_logger.rb | 0 .../code0/zero_track/migration/create_table_with_timestamps.rb | 0 .../cop/code0/zero_track/migration/datetime.rb | 0 .../cop/code0/zero_track/migration/timestamps.rb | 0 .../cop/code0/zero_track/migration/versioned_class.rb | 0 rubocop-zero_track.yml => rubocop/rubocop-config.yml | 2 +- {lib/rubocop => rubocop}/zero_track.rb | 0 spec/spec_helper.rb | 2 +- 10 files changed, 3 insertions(+), 3 deletions(-) rename {lib/rubocop => rubocop}/code0/zero_track/file_helpers.rb (100%) rename {lib/rubocop => rubocop}/cop/code0/zero_track/logs/rails_logger.rb (100%) rename {lib/rubocop => rubocop}/cop/code0/zero_track/migration/create_table_with_timestamps.rb (100%) rename {lib/rubocop => rubocop}/cop/code0/zero_track/migration/datetime.rb (100%) rename {lib/rubocop => rubocop}/cop/code0/zero_track/migration/timestamps.rb (100%) rename {lib/rubocop => rubocop}/cop/code0/zero_track/migration/versioned_class.rb (100%) rename rubocop-zero_track.yml => rubocop/rubocop-config.yml (91%) rename {lib/rubocop => rubocop}/zero_track.rb (100%) diff --git a/code0-zero_track.gemspec b/code0-zero_track.gemspec index 4b708a3..f60c092 100644 --- a/code0-zero_track.gemspec +++ b/code0-zero_track.gemspec @@ -18,7 +18,7 @@ Gem::Specification.new do |spec| spec.metadata['rubygems_mfa_required'] = 'true' spec.files = Dir.chdir(File.expand_path(__dir__)) do - Dir['{app,config,db,lib}/**/*', 'LICENSE', 'Rakefile', 'README.md', 'rubocop-zero_track.yml'] + Dir['{app,config,db,lib,rubocop}/**/*', 'LICENSE', 'Rakefile', 'README.md'] end spec.add_dependency 'rails', '>= 8.0.1' diff --git a/lib/rubocop/code0/zero_track/file_helpers.rb b/rubocop/code0/zero_track/file_helpers.rb similarity index 100% rename from lib/rubocop/code0/zero_track/file_helpers.rb rename to rubocop/code0/zero_track/file_helpers.rb diff --git a/lib/rubocop/cop/code0/zero_track/logs/rails_logger.rb b/rubocop/cop/code0/zero_track/logs/rails_logger.rb similarity index 100% rename from lib/rubocop/cop/code0/zero_track/logs/rails_logger.rb rename to rubocop/cop/code0/zero_track/logs/rails_logger.rb diff --git a/lib/rubocop/cop/code0/zero_track/migration/create_table_with_timestamps.rb b/rubocop/cop/code0/zero_track/migration/create_table_with_timestamps.rb similarity index 100% rename from lib/rubocop/cop/code0/zero_track/migration/create_table_with_timestamps.rb rename to rubocop/cop/code0/zero_track/migration/create_table_with_timestamps.rb diff --git a/lib/rubocop/cop/code0/zero_track/migration/datetime.rb b/rubocop/cop/code0/zero_track/migration/datetime.rb similarity index 100% rename from lib/rubocop/cop/code0/zero_track/migration/datetime.rb rename to rubocop/cop/code0/zero_track/migration/datetime.rb diff --git a/lib/rubocop/cop/code0/zero_track/migration/timestamps.rb b/rubocop/cop/code0/zero_track/migration/timestamps.rb similarity index 100% rename from lib/rubocop/cop/code0/zero_track/migration/timestamps.rb rename to rubocop/cop/code0/zero_track/migration/timestamps.rb diff --git a/lib/rubocop/cop/code0/zero_track/migration/versioned_class.rb b/rubocop/cop/code0/zero_track/migration/versioned_class.rb similarity index 100% rename from lib/rubocop/cop/code0/zero_track/migration/versioned_class.rb rename to rubocop/cop/code0/zero_track/migration/versioned_class.rb diff --git a/rubocop-zero_track.yml b/rubocop/rubocop-config.yml similarity index 91% rename from rubocop-zero_track.yml rename to rubocop/rubocop-config.yml index e27379c..d4a2bc7 100644 --- a/rubocop-zero_track.yml +++ b/rubocop/rubocop-config.yml @@ -1,5 +1,5 @@ require: - - ./lib/rubocop/zero_track + - ./zero_track Code0/ZeroTrack/Logs/RailsLogger: Enabled: false diff --git a/lib/rubocop/zero_track.rb b/rubocop/zero_track.rb similarity index 100% rename from lib/rubocop/zero_track.rb rename to rubocop/zero_track.rb diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6fc1f92..c37277f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -17,7 +17,7 @@ require 'rubocop' require 'rubocop/rspec/support' -require 'rubocop/zero_track' # our entrypoint +require 'code0/zero_track/../../../rubocop/zero_track' RSpec.configure do |config| # Enable flags like --only-failures and --next-failure