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
11 changes: 7 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ gem 'pry'

gem 'packs-specification'

gem 'rake', '~> 13.0'
gem 'rake', '~> 13.4'
gem 'rspec', '~> 3.13'

gem 'rubocop', '~> 1.74'
gem 'rubocop-performance', '~> 1.24'
gem 'rubocop-sorbet', '~> 0.9'
gem 'rubocop', '~> 1.91'
gem 'rubocop-performance', '~> 1.27'
gem 'rubocop-sorbet', '~> 0.16'

gem 'sorbet'
gem 'tapioca'

# Unreleased fix for parsing `...` params (Shopify/rbi#625), needed by tapioca's RBS rewriter on herb 0.11
gem 'rbi', github: 'Shopify/rbi'
181 changes: 99 additions & 82 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
GIT
remote: https://github.com/Shopify/rbi.git
revision: 40f1046d18efa4d268b46df4df79efd36f15b681
specs:
rbi (0.4.3)
prism (~> 1.0)
rbs (>= 4.0.1)

PATH
remote: .
specs:
Expand All @@ -13,13 +21,13 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actionview (8.1.3)
activesupport (= 8.1.3)
actionview (8.1.4)
activesupport (= 8.1.4)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activesupport (8.1.3)
activesupport (8.1.4)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
Expand All @@ -33,43 +41,44 @@ GEM
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ast (2.4.3)
base64 (0.2.0)
benchmark (0.4.0)
better_html (2.1.1)
actionview (>= 6.0)
activesupport (>= 6.0)
base64 (0.3.0)
benchmark (0.5.0)
better_html (2.2.0)
actionview (>= 7.0)
activesupport (>= 7.0)
ast (~> 2.0)
erubi (~> 1.4)
parser (>= 2.4)
smart_properties
bigdecimal (4.1.3)
builder (3.3.0)
coderay (1.1.3)
concurrent-ruby (1.3.7)
connection_pool (2.5.0)
constant_resolver (0.2.0)
concurrent-ruby (1.3.8)
connection_pool (3.0.2)
constant_resolver (0.3.0)
crass (1.0.7)
date (3.4.1)
diff-lcs (1.6.2)
drb (2.2.1)
drb (2.2.3)
erb (6.0.7)
erubi (1.13.1)
herb (0.11.0-aarch64-linux-gnu)
herb (0.11.0-aarch64-linux-musl)
herb (0.11.0-arm64-darwin)
herb (0.11.0-x86_64-darwin)
herb (0.11.0-x86_64-linux-gnu)
herb (0.11.0-x86_64-linux-musl)
i18n (1.14.7)
i18n (1.15.2)
concurrent-ruby (~> 1.0)
io-console (0.8.0)
irb (1.15.1)
io-console (0.9.4)
irb (1.18.0)
pp (>= 0.6.0)
prism (>= 1.3.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.21.2)
language_server-protocol (3.17.0.5)
json (3.0.2)
language_server-protocol (3.17.0.6)
lint_roller (1.1.0)
logger (1.6.6)
logger (1.7.0)
loofah (2.25.2)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
Expand All @@ -92,56 +101,56 @@ GEM
racc (~> 1.4)
packs-specification (0.0.11)
sorbet-runtime
packwerk (3.2.2)
packwerk (3.3.1)
activesupport (>= 6.0)
ast
benchmark
better_html
bundler
constant_resolver (>= 0.2.0)
constant_resolver (>= 0.3)
parallel
parser
prism (>= 0.25.0)
sorbet-runtime (>= 0.5.9914)
prism (>= 1.4.0)
zeitwerk (>= 2.6.1)
parallel (2.1.0)
parallel (2.3.0)
parse_packwerk (0.28.0)
bigdecimal
sorbet-runtime
parser (3.3.11.1)
parser (3.3.12.0)
ast (~> 2.4.1)
racc
pp (0.6.2)
pp (0.6.4)
prettyprint
prettyprint (0.2.0)
prettyprint (0.2.1)
prism (1.9.0)
pry (0.16.0)
coderay (~> 1.1)
method_source (~> 1.0)
reline (>= 0.6.0)
psych (5.2.3)
date
stringio
racc (1.8.1)
rails-dom-testing (2.2.0)
rails-dom-testing (2.3.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.7.1)
loofah (~> 2.25, >= 2.25.2)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
rainbow (3.1.1)
rake (13.2.1)
rbi (0.3.1)
prism (~> 1.0)
rbs (>= 3.4.4)
sorbet-runtime (>= 0.5.9204)
rbs (3.9.0)
rake (13.4.2)
rbs (4.2.0)
logger
rdoc (6.12.0)
psych (>= 4.0.0)
regexp_parser (2.12.0)
reline (0.6.0)
prism (>= 1.6.0)
tsort
rdoc (8.1.0)
erb
prism (>= 1.6.0)
rbs (>= 4.0.0)
tsort
regexp_parser (2.13.1)
reline (0.7.0)
io-console (~> 0.5)
require-hooks (0.5.1)
rexml (3.4.4)
rspec (3.13.2)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
Expand All @@ -155,68 +164,75 @@ GEM
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.7)
rubocop (1.88.1)
json (~> 2.3)
rubocop (1.92.0)
json (>= 2.3)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.1.0)
parallel (>= 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
regexp_parser (>= 2.11.3, < 3.0)
rubocop-ast (>= 1.49.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.49.1)
rubocop-ast (1.50.0)
parser (>= 3.3.7.2)
prism (~> 1.7)
rubocop-performance (1.24.0)
rubocop-performance (1.27.0)
lint_roller (~> 1.1)
rubocop (>= 1.72.1, < 2.0)
rubocop-ast (>= 1.38.0, < 2.0)
rubocop-sorbet (0.9.0)
lint_roller (~> 1.1)
rubocop (>= 1)
rubocop (>= 1.89.0, < 2.0)
rubocop-ast (>= 1.47.1, < 2.0)
rubocop-sorbet (0.17.1)
lint_roller
rbi (~> 0.4, >= 0.4.3)
rbs (>= 4.1.1)
rubocop (>= 1.75.2)
spoom (~> 1.8)
ruby-progressbar (1.13.0)
rubydex (0.4.1-aarch64-linux)
rubydex (0.4.1-arm64-darwin)
rubydex (0.4.1-x86_64-darwin)
rubydex (0.4.1-x86_64-linux)
securerandom (0.4.1)
smart_properties (1.17.0)
sorbet (0.5.11953)
sorbet-static (= 0.5.11953)
sorbet-runtime (0.5.11953)
sorbet-static (0.5.11953-aarch64-linux)
sorbet-static (0.5.11953-universal-darwin)
sorbet-static (0.5.11953-x86_64-linux)
sorbet-static-and-runtime (0.5.11953)
sorbet (= 0.5.11953)
sorbet-runtime (= 0.5.11953)
spoom (1.6.1)
sorbet (0.6.13550)
sorbet-static (= 0.6.13550)
sorbet-runtime (0.6.13550)
sorbet-static (0.6.13550-aarch64-linux)
sorbet-static (0.6.13550-universal-darwin)
sorbet-static (0.6.13550-x86_64-linux)
sorbet-static-and-runtime (0.6.13550)
sorbet (= 0.6.13550)
sorbet-runtime (= 0.6.13550)
spoom (1.8.10)
erubi (>= 1.10.0)
prism (>= 0.28.0)
rbi (>= 0.2.3)
rbi (>= 0.4.2)
rbs (>= 4.0.0.dev.5)
rexml (>= 3.2.6)
sorbet-static-and-runtime (>= 0.5.10187)
thor (>= 0.19.2)
stringio (3.1.5)
tapioca (0.16.11)
tapioca (0.20.0)
benchmark
bundler (>= 2.2.25)
netrc (>= 0.11.0)
parallel (>= 1.21.0)
rbi (~> 0.2)
sorbet-static-and-runtime (>= 0.5.11087)
spoom (>= 1.2.0)
rbi (>= 0.4.1)
require-hooks (>= 0.2.2)
rubydex (>= 0.1.0.beta10)
sorbet-static-and-runtime (>= 0.6.12698)
spoom (>= 1.7.16)
thor (>= 1.2.0)
yard-sorbet
thor (1.3.2)
tsort
thor (1.5.0)
tsort (0.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
uri (1.1.1)
yard (0.9.44)
yard-sorbet (0.9.0)
sorbet-runtime
yard
zeitwerk (2.7.2)
unicode-display_width (3.3.0)
unicode-emoji (~> 4.3)
unicode-emoji (4.3.0)
uri (1.1.2)
zeitwerk (2.8.3)

PLATFORMS
aarch64-linux
Expand All @@ -234,11 +250,12 @@ DEPENDENCIES
packs-specification
pry
query_packwerk!
rake (~> 13.0)
rake (~> 13.4)
rbi!
rspec (~> 3.13)
rubocop (~> 1.74)
rubocop-performance (~> 1.24)
rubocop-sorbet (~> 0.9)
rubocop (~> 1.91)
rubocop-performance (~> 1.27)
rubocop-sorbet (~> 0.16)
sorbet
tapioca

Expand Down
4 changes: 2 additions & 2 deletions lib/query_packwerk/file_cache.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class FileCache
extend T::Sig

# The files packwerk parses as Ruby, from Packwerk::Parsers::Factory
RUBY_FILE = T.let(/(\.(rb|rake|builder|gemspec|ru)|Gemfile|Rakefile)\z/, Regexp)
ERB_FILE = T.let(/\.erb\z/, Regexp)
RUBY_FILE = /(\.(rb|rake|builder|gemspec|ru)|Gemfile|Rakefile)\z/
ERB_FILE = /\.erb\z/

sig { void }
def initialize
Expand Down
2 changes: 1 addition & 1 deletion lib/query_packwerk/packages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class Packages

Elem = type_member { { fixed: QueryPackwerk::Package } }

UNOWNED = T.let('Unowned', String)
UNOWNED = 'Unowned'

include Enumerable
include QueryInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class AnonymizeArgumentsRule < BaseRule
extend T::Sig

# Arguments prefixed with a sigil like `*arg` and `&fn`
SIGIL_ARGS = T.let(%i[splat block_pass].freeze, T::Array[Symbol])
SIGIL_ARGS = %i[splat block_pass].freeze

sig { override.params(node: RuboCop::AST::Node).void }
def on_send(node)
Expand Down
4 changes: 2 additions & 2 deletions lib/query_packwerk/violation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module QueryPackwerk
class Violation
extend T::Sig

ALL_CAPS = T.let(/\A[A-Z_]+\z/, Regexp)
ALL_CAPS = /\A[A-Z_]+\z/

sig { returns(QueryPackwerk::Package) }
attr_reader :producing_pack
Expand Down Expand Up @@ -37,7 +37,7 @@ def initialize(original_violation:, consuming_pack:, file_cache: QueryPackwerk::
QueryPackwerk::Package
)

@file_cache = T.let(file_cache, QueryPackwerk::FileCache)
@file_cache = file_cache
@cache_loaded = T.let(false, T::Boolean)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/query_packwerk/violations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def reload!
end
def initialize(original_collection, file_cache: QueryPackwerk::FileCache.new)
@original_collection = original_collection
@file_cache = T.let(file_cache, QueryPackwerk::FileCache)
@file_cache = file_cache

@original_collection.each do |violation|
violation.set_cache!(file_cache)
Expand Down
Loading
Loading