Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ gem "sorbet"
gem "tapioca", ">= 0.17", require: false
gem "minitest", "~> 5.16"

gem "rubocop", "~> 1.21"
gem "rubocop-shopify", require: false
gem "rubocop-minitest", require: false
gem "rubocop-rake", require: false
7 changes: 4 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
PATH
remote: .
specs:
type_toolkit (0.0.3)
type_toolkit (0.0.4)
lint_roller
rubocop (>= 1.72.0)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -124,7 +126,6 @@ DEPENDENCIES
irb
minitest (~> 5.16)
rake (~> 13.0)
rubocop (~> 1.21)
rubocop-minitest
rubocop-rake
rubocop-shopify
Expand Down Expand Up @@ -178,7 +179,7 @@ CHECKSUMS
tapioca (0.17.10) sha256=880a682ca8314f798dd09e9f104134fbf1a713c13be51f7dd4741dd434e6471b
thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
type_toolkit (0.0.3)
type_toolkit (0.0.4)
unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42
unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f
yard (0.9.38) sha256=721fb82afb10532aa49860655f6cc2eaa7130889df291b052e1e6b268283010f
Expand Down
4 changes: 1 addition & 3 deletions lib/rubocop-type_toolkit.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "rubocop"

RuboCop::ConfigLoader.inject_defaults!(File.join(__dir__, "..", "config", "default.yml"))

require_relative "rubocop/cop/type_toolkit/plugin"
require_relative "rubocop/cop/type_toolkit/dont_expect_unexpected_nil"
33 changes: 33 additions & 0 deletions lib/rubocop/cop/type_toolkit/plugin.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# typed: false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of the project uses # typed: true or # typed: strong — any reason this one is # typed: false? I think we could bump it to # typed: true and add RBS-style signatures to the overridden methods, similar to how dont_expect_unexpected_nil.rb does it:

Suggested change
# typed: false
# typed: true

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this at false?

# frozen_string_literal: true

require "lint_roller"

module RuboCop
module Cop
module TypeToolkit
class Plugin < LintRoller::Plugin
def about
LintRoller::About.new(
name: "rubocop-type_toolkit",
version: ::TypeToolkit::VERSION,
homepage: "https://github.com/Shopify/type_toolkit",
description: "Detects misuse of UnexpectedNilError.",
)
end

def supported?(context)
context.engine == :rubocop
end

def rules(_context)
LintRoller::Rules.new(
type: :path,
config_format: :rubocop,
value: Pathname.new(__dir__).join("../../../../config/default.yml"),
)
end
end
end
end
end
2 changes: 1 addition & 1 deletion lib/type_toolkit/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# frozen_string_literal: true

module TypeToolkit
VERSION = "0.0.3"
VERSION = "0.0.4"
end
204 changes: 204 additions & 0 deletions sorbet/rbi/gems/lint_roller@1.1.0.rbi

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions sorbet/rbi/shims/lint_roller.rbi

This file was deleted.

8 changes: 3 additions & 5 deletions type_toolkit.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Gem::Specification.new do |spec|
spec.metadata["allowed_push_host"] = "https://rubygems.org"
spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = spec.homepage
spec.metadata["default_lint_roller_plugin"] = "RuboCop::Cop::TypeToolkit::Plugin"

# Specify which files should be added to the gem when it is released.
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
Expand All @@ -32,9 +33,6 @@ Gem::Specification.new do |spec|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]

# Uncomment to register a new dependency of your gem
# spec.add_dependency "example-gem", "~> 1.0"

# For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html
spec.add_dependency("lint_roller")
spec.add_dependency("rubocop", ">= 1.72.0")
end
Loading