From 75d9d6c6a113f998f37de0bcfb230ac35df59fd4 Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Mon, 31 Jan 2022 16:34:39 -0500 Subject: [PATCH] Auto-correct style offenses --- lib/tapioca/compilers/dsl/aasm.rb | 2 +- lib/tapioca/compilers/dsl/active_record_relations.rb | 2 +- .../compilers/dsl/helpers/active_record_column_type_helper.rb | 2 +- lib/tapioca/compilers/symbol_table_compiler.rb | 2 +- lib/tapioca/helpers/config_helper.rb | 2 +- lib/tapioca/rbi_ext/model.rb | 2 +- lib/tapioca/trackers/autoload.rb | 2 +- spec/tapioca/compilers/symbol_table_compiler_spec.rb | 2 +- tapioca.gemspec | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/tapioca/compilers/dsl/aasm.rb b/lib/tapioca/compilers/dsl/aasm.rb index 419cf9cc7..24f615456 100644 --- a/lib/tapioca/compilers/dsl/aasm.rb +++ b/lib/tapioca/compilers/dsl/aasm.rb @@ -45,7 +45,7 @@ class AASM < Tapioca::Compilers::Dsl::Base EVENT_CALLBACKS = T.let( ["after", "after_commit", "after_transaction", "before", "before_transaction", "ensure", "error", - "before_success", "success"].freeze, + "before_success", "success",].freeze, T::Array[String] ) diff --git a/lib/tapioca/compilers/dsl/active_record_relations.rb b/lib/tapioca/compilers/dsl/active_record_relations.rb index 21c648f91..240e4ee20 100644 --- a/lib/tapioca/compilers/dsl/active_record_relations.rb +++ b/lib/tapioca/compilers/dsl/active_record_relations.rb @@ -402,7 +402,7 @@ def create_collection_proxy_methods(klass) # `T.any(Model, Integer, String, T::Enumerable[T.any(Model, Integer, String, T::Enumerable[Model])])` model_or_id_collection = "T.any(#{constant_name}, Integer, String" \ - ", T::Enumerable[T.any(#{constant_name}, Integer, String, T::Enumerable[#{constant_name}])])" + ", T::Enumerable[T.any(#{constant_name}, Integer, String, T::Enumerable[#{constant_name}])])" COLLECTION_PROXY_METHODS.each do |method_name| case method_name diff --git a/lib/tapioca/compilers/dsl/helpers/active_record_column_type_helper.rb b/lib/tapioca/compilers/dsl/helpers/active_record_column_type_helper.rb index 97446c827..2d994ff4f 100644 --- a/lib/tapioca/compilers/dsl/helpers/active_record_column_type_helper.rb +++ b/lib/tapioca/compilers/dsl/helpers/active_record_column_type_helper.rb @@ -64,7 +64,7 @@ def type_for(column_name) sig { params(constant: Module).returns(T::Boolean) } def do_not_generate_strong_types?(constant) Object.const_defined?(:StrongTypeGeneration) && - !(constant.singleton_class < Object.const_get(:StrongTypeGeneration)) + !(constant.singleton_class < Object.const_get(:StrongTypeGeneration)) end sig { params(type: String).returns(String) } diff --git a/lib/tapioca/compilers/symbol_table_compiler.rb b/lib/tapioca/compilers/symbol_table_compiler.rb index 2062280c8..d0b93734e 100644 --- a/lib/tapioca/compilers/symbol_table_compiler.rb +++ b/lib/tapioca/compilers/symbol_table_compiler.rb @@ -608,7 +608,7 @@ def filtered_mixin?(mixin_name) SPECIAL_METHOD_NAMES = T.let([ "!", "~", "+@", "**", "-@", "*", "/", "%", "+", "-", "<<", ">>", "&", "|", "^", - "<", "<=", "=>", ">", ">=", "==", "===", "!=", "=~", "!~", "<=>", "[]", "[]=", "`" + "<", "<=", "=>", ">", ">=", "==", "===", "!=", "=~", "!~", "<=>", "[]", "[]=", "`", ], T::Array[String]) sig { params(name: String).returns(T::Boolean) } diff --git a/lib/tapioca/helpers/config_helper.rb b/lib/tapioca/helpers/config_helper.rb index 127259637..3c31ee63a 100644 --- a/lib/tapioca/helpers/config_helper.rb +++ b/lib/tapioca/helpers/config_helper.rb @@ -123,7 +123,7 @@ def validate_config_options(command_options, config_key, config_options) end error_msg = "invalid value for option `#{config_option_key}` for key `#{config_key}` - expected " \ - "`#{command_option.type.capitalize}` but found #{config_option_value_type.capitalize}" + "`#{command_option.type.capitalize}` but found #{config_option_value_type.capitalize}" next build_error(error_msg) unless config_option_value_type == command_option.type end.compact end diff --git a/lib/tapioca/rbi_ext/model.rb b/lib/tapioca/rbi_ext/model.rb index 974fd34af..a7a9b1c51 100644 --- a/lib/tapioca/rbi_ext/model.rb +++ b/lib/tapioca/rbi_ext/model.rb @@ -132,7 +132,7 @@ def create_method(name, parameters: [], return_type: "T.untyped", class_method: SPECIAL_METHOD_NAMES = T.let( ["!", "~", "+@", "**", "-@", "*", "/", "%", "+", "-", "<<", ">>", "&", "|", "^", "<", "<=", "=>", ">", ">=", - "==", "===", "!=", "=~", "!~", "<=>", "[]", "[]=", "`"].freeze, + "==", "===", "!=", "=~", "!~", "<=>", "[]", "[]=", "`",].freeze, T::Array[String] ) diff --git a/lib/tapioca/trackers/autoload.rb b/lib/tapioca/trackers/autoload.rb index 78c52e488..f1eca5714 100644 --- a/lib/tapioca/trackers/autoload.rb +++ b/lib/tapioca/trackers/autoload.rb @@ -6,7 +6,7 @@ module Trackers module Autoload extend T::Sig - NOOP_METHOD = -> (*_args, **_kwargs, &_block) {} + NOOP_METHOD = ->(*_args, **_kwargs, &_block) {} @constant_names_registered_for_autoload = T.let([], T::Array[String]) diff --git a/spec/tapioca/compilers/symbol_table_compiler_spec.rb b/spec/tapioca/compilers/symbol_table_compiler_spec.rb index 9350a4e32..9bf2bb10c 100644 --- a/spec/tapioca/compilers/symbol_table_compiler_spec.rb +++ b/spec/tapioca/compilers/symbol_table_compiler_spec.rb @@ -954,7 +954,7 @@ module Foo def foo end end - RUBY + RUBY add_ruby_file("toto.rb", <<~RUBY) module Toto diff --git a/tapioca.gemspec b/tapioca.gemspec index c675ec4a8..bac516e54 100644 --- a/tapioca.gemspec +++ b/tapioca.gemspec @@ -26,8 +26,8 @@ Gem::Specification.new do |spec| spec.add_dependency("bundler", ">= 1.17.3") spec.add_dependency("pry", ">= 0.12.2") spec.add_dependency("rbi", "~> 0.0.0", ">= 0.0.9") - spec.add_dependency("sorbet-static", ">= 0.5.9204") spec.add_dependency("sorbet-runtime", ">= 0.5.9204") + spec.add_dependency("sorbet-static", ">= 0.5.9204") spec.add_dependency("spoom", "~> 1.1.0", ">= 1.1.4") spec.add_dependency("thor", ">= 1.2.0") spec.add_dependency("yard-sorbet")