brew vendor-gems: commit updates.
This commit is contained in:
parent
817bf2d774
commit
92564096c7
@ -88,7 +88,7 @@ $:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-1.25.1/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-performance-1.13.2/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rails-2.13.2/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-rspec-2.8.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.5/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/rubocop-sorbet-0.6.6/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/ruby-macho-3.0.0/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov-html-0.12.3/lib"
|
||||
$:.unshift "#{path}/../#{ruby_engine}/#{ruby_version}/gems/simplecov_json_formatter-0.1.3/lib"
|
||||
|
||||
@ -197,6 +197,17 @@ Sorbet/TrueSigil:
|
||||
- db/**/*.rb
|
||||
- script/**/*
|
||||
|
||||
Sorbet/TypeAliasName:
|
||||
Description: 'Type alias constant names must be in CamelCase.'
|
||||
Enabled: true
|
||||
VersionAdded: 0.6.6
|
||||
Include:
|
||||
- "**/*.{rb,rbi,rake,ru}"
|
||||
Exclude:
|
||||
- bin/**/*
|
||||
- db/**/*.rb
|
||||
- script/**/*
|
||||
|
||||
Sorbet/ValidSigil:
|
||||
Description: 'All files must have a valid sigil.'
|
||||
Enabled: true
|
||||
@ -220,6 +220,9 @@ Sorbet/SignatureBuildOrder:
|
||||
Sorbet/SingleLineRbiClassModuleDefinitions:
|
||||
Enabled: true
|
||||
|
||||
Sorbet/TypeAliasName:
|
||||
Enabled: true
|
||||
|
||||
Sorbet/ValidSigil:
|
||||
Enabled: true
|
||||
RequireSigilOnAllFiles: true
|
||||
@ -0,0 +1,45 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require "rubocop"
|
||||
|
||||
module RuboCop
|
||||
module Cop
|
||||
module Sorbet
|
||||
# This cop ensures all constants used as `T.type_alias` are using CamelCase.
|
||||
#
|
||||
# @example
|
||||
#
|
||||
# # bad
|
||||
# FOO_OR_BAR = T.type_alias { T.any(Foo, Bar) }
|
||||
#
|
||||
# # good
|
||||
# FooOrBar = T.type_alias { T.any(Foo, Bar) }
|
||||
class TypeAliasName < RuboCop::Cop::Cop
|
||||
MSG = "Type alias constant name should be in CamelCase"
|
||||
|
||||
def_node_matcher(:casgn_type_alias?, <<-PATTERN)
|
||||
(casgn
|
||||
_
|
||||
_
|
||||
(block
|
||||
(send
|
||||
(const nil? :T) :type_alias)
|
||||
_
|
||||
_
|
||||
))
|
||||
PATTERN
|
||||
|
||||
def on_casgn(node)
|
||||
return unless casgn_type_alias?(node)
|
||||
|
||||
name = node.children[1]
|
||||
|
||||
# From https://github.com/rubocop/rubocop/blob/master/lib/rubocop/cop/naming/class_and_module_camel_case.rb
|
||||
return unless /_/.match?(name)
|
||||
|
||||
add_offense(node)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -7,6 +7,7 @@ require_relative "sorbet/forbid_untyped_struct_props"
|
||||
require_relative "sorbet/one_ancestor_per_line"
|
||||
require_relative "sorbet/callback_conditionals_binding"
|
||||
require_relative "sorbet/forbid_t_unsafe"
|
||||
require_relative "sorbet/type_alias_name"
|
||||
|
||||
require_relative "sorbet/rbi/forbid_extend_t_sig_helpers_in_shims"
|
||||
require_relative "sorbet/rbi/forbid_rbi_outside_of_allowed_paths"
|
||||
@ -1,6 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
module RuboCop
|
||||
module Sorbet
|
||||
VERSION = "0.6.5"
|
||||
VERSION = "0.6.6"
|
||||
end
|
||||
end
|
||||
Loading…
x
Reference in New Issue
Block a user