Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backwards compatible with Ruby 3 #366

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5bb5f3c
Patch to support Rails 5.0
bravehager Jun 19, 2021
284417e
add support for autoloading validation for classic mode
bravehager Jun 23, 2021
fe19945
add tests for classic mode autoloading validation
bravehager Jun 23, 2021
1843382
rubocop
bravehager Jun 23, 2021
c954655
add detect-zeitwerk-violations command to cli
bravehager Jun 23, 2021
ad0d503
Merge branch 'main' of https://github.com/justworkshr/packwerk
bravehager Jun 23, 2021
f3733ef
use heuristic to determine autoloadable constants in zeitwerk validation
bravehager Jun 23, 2021
2e774b8
use heuristic to determine autoloadable constants in zeitwerk validation
bravehager Jun 23, 2021
a81cc80
update zeitwerk cli commands
bravehager Jun 23, 2021
218b359
move zeitwerk validation support into main package
bravehager Jun 23, 2021
73782a5
Merge branch 'validate-zeitwerk' of https://github.com/justworkshr/pa…
bravehager Jun 23, 2021
1768942
adjust heuristic to reduce false negatives when finding direct match
bravehager Jun 23, 2021
8597c7b
rename ExtractLoadableConstantDefinitions to ExtractLoadableConstantD…
bravehager Jun 23, 2021
8ab7d15
don't prune definitions from ExtractLoadableConstantDefinitions using…
bravehager Jun 24, 2021
ed9302f
configure zeitwerk commands to use progress_formatter and offenses_fo…
bravehager Jun 25, 2021
717f303
add type signatures to ExtractLoadableConstantDefinitions
bravehager Jun 25, 2021
a73f6c9
disable new rubocop cops to support ruby 2.6
bravehager Jun 25, 2021
a320457
Merge branch 'main' of https://github.com/Shopify/packwerk
bravehager Jun 25, 2021
f55b30b
Merge branch 'main' of https://github.com/justworkshr/packwerk into v…
bravehager Jun 25, 2021
6ad6d36
update validate-zeitwerk to detect stale violations
bravehager Jun 25, 2021
45f9146
format heredocs
bravehager Jun 25, 2021
ca0a9a7
Prepare for 1.3.0
bravehager Jun 28, 2021
f7a642d
Merge pull request #1 from justworkshr/validate-zeitwerk
bravehager Jun 28, 2021
eb08e2c
patch deprecated_references to not rely on active support extensions
bravehager Jul 13, 2021
d8af936
bump patch version
bravehager Jul 13, 2021
39f672d
Merge pull request #2 from justworkshr/patch-deprecated-references-fo…
bravehager Jul 13, 2021
bc0859d
Update custom.rb
maxveldink Aug 1, 2023
6f4cb90
Merge pull request #16 from justworkshr/maxveldink-patch-1
maxveldink Aug 1, 2023
139aa4f
Update custom.rb
maxveldink Aug 1, 2023
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
25 changes: 17 additions & 8 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
inherit_gem:
rubocop-shopify: rubocop.yml
rubocop-shopify: rubocop.yml

require:
- rubocop-performance
- rubocop-sorbet

AllCops:
NewCops: disable
TargetRubyVersion: 2.7
UseCache: true
CacheRootDirectory: tmp
SuggestExtensions: false
Exclude:
- 'test/fixtures/**/*'
- "test/fixtures/**/*"
- "bin/*"

Lint/UnusedMethodArgument:
AllowUnusedKeywordArguments: true
Expand All @@ -19,13 +22,13 @@ Style/MethodCallWithArgsParentheses:
Enabled: true
IgnoreMacros: true
IgnoredMethods:
- require
- require_relative
- require_dependency
- yield
- raise
- require
- require_relative
- require_dependency
- yield
- raise
Exclude:
- Gemfile
- Gemfile

Style/StringLiterals:
EnforcedStyle: double_quotes
Expand All @@ -44,3 +47,9 @@ Sorbet/KeywordArgumentOrdering:

Sorbet/ValidSigil:
Enabled: true
Exclude:
- "test/**/*"

Sorbet/FalseSigil:
Exclude:
- "test/**/*"
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.0
2.7.1
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gemspec
# Specify the same dependency sources as the application Gemfile

gem("spring")
gem("rails", github: "rails/rails", branch: "main")
gem("rails", "~> 5.0.7", ">= 5.0.7.2")
gem("constant_resolver", require: false)
gem("sorbet-runtime", require: false)
gem("rubocop-performance", require: false)
Expand Down
196 changes: 83 additions & 113 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,94 +1,8 @@
GIT
remote: https://github.com/rails/rails.git
revision: d612542336d9a61381311c95a27d801bb4094779
branch: main
specs:
actioncable (7.0.0.alpha)
actionpack (= 7.0.0.alpha)
activesupport (= 7.0.0.alpha)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (7.0.0.alpha)
actionpack (= 7.0.0.alpha)
activejob (= 7.0.0.alpha)
activerecord (= 7.0.0.alpha)
activestorage (= 7.0.0.alpha)
activesupport (= 7.0.0.alpha)
mail (>= 2.7.1)
actionmailer (7.0.0.alpha)
actionpack (= 7.0.0.alpha)
actionview (= 7.0.0.alpha)
activejob (= 7.0.0.alpha)
activesupport (= 7.0.0.alpha)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (7.0.0.alpha)
actionview (= 7.0.0.alpha)
activesupport (= 7.0.0.alpha)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (7.0.0.alpha)
actionpack (= 7.0.0.alpha)
activerecord (= 7.0.0.alpha)
activestorage (= 7.0.0.alpha)
activesupport (= 7.0.0.alpha)
nokogiri (>= 1.8.5)
actionview (7.0.0.alpha)
activesupport (= 7.0.0.alpha)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (7.0.0.alpha)
activesupport (= 7.0.0.alpha)
globalid (>= 0.3.6)
activemodel (7.0.0.alpha)
activesupport (= 7.0.0.alpha)
activerecord (7.0.0.alpha)
activemodel (= 7.0.0.alpha)
activesupport (= 7.0.0.alpha)
activestorage (7.0.0.alpha)
actionpack (= 7.0.0.alpha)
activejob (= 7.0.0.alpha)
activerecord (= 7.0.0.alpha)
activesupport (= 7.0.0.alpha)
marcel (~> 1.0.0)
mini_mime (~> 1.0.2)
activesupport (7.0.0.alpha)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
rails (7.0.0.alpha)
actioncable (= 7.0.0.alpha)
actionmailbox (= 7.0.0.alpha)
actionmailer (= 7.0.0.alpha)
actionpack (= 7.0.0.alpha)
actiontext (= 7.0.0.alpha)
actionview (= 7.0.0.alpha)
activejob (= 7.0.0.alpha)
activemodel (= 7.0.0.alpha)
activerecord (= 7.0.0.alpha)
activestorage (= 7.0.0.alpha)
activesupport (= 7.0.0.alpha)
bundler (>= 1.15.0)
railties (= 7.0.0.alpha)
sprockets-rails (>= 2.0.0)
railties (7.0.0.alpha)
actionpack (= 7.0.0.alpha)
activesupport (= 7.0.0.alpha)
method_source
rake (>= 0.13)
thor (~> 1.0)

PATH
remote: .
specs:
packwerk (1.2.0)
activesupport (>= 5.2)
packwerk (1.3.0)
activesupport (>= 5.0)
ast
better_html
constant_resolver
Expand All @@ -99,6 +13,44 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actioncable (5.0.7.2)
actionpack (= 5.0.7.2)
nio4r (>= 1.2, < 3.0)
websocket-driver (~> 0.6.1)
actionmailer (5.0.7.2)
actionpack (= 5.0.7.2)
actionview (= 5.0.7.2)
activejob (= 5.0.7.2)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.0.7.2)
actionview (= 5.0.7.2)
activesupport (= 5.0.7.2)
rack (~> 2.0)
rack-test (~> 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.0.7.2)
activesupport (= 5.0.7.2)
builder (~> 3.1)
erubis (~> 2.7.0)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.0.7.2)
activesupport (= 5.0.7.2)
globalid (>= 0.3.6)
activemodel (5.0.7.2)
activesupport (= 5.0.7.2)
activerecord (5.0.7.2)
activemodel (= 5.0.7.2)
activesupport (= 5.0.7.2)
arel (~> 7.0)
activesupport (5.0.7.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
arel (7.1.4)
ast (2.4.2)
better_html (1.0.16)
actionview (>= 4.0)
Expand All @@ -112,39 +64,39 @@ GEM
byebug (11.1.3)
coderay (1.1.3)
colorize (0.8.1)
commander (4.5.2)
commander (4.6.0)
highline (~> 2.0.0)
concurrent-ruby (1.1.8)
concurrent-ruby (1.1.9)
constant_resolver (0.1.5)
crass (1.0.6)
erubi (1.10.0)
erubis (2.7.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
highline (2.0.3)
html_tokenizer (0.0.7)
i18n (1.8.10)
concurrent-ruby (~> 1.0)
loofah (2.9.0)
loofah (2.10.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
m (1.5.1)
method_source (>= 0.6.7)
rake (>= 0.9.2.2)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (1.0.0)
method_source (1.0.0)
mini_mime (1.0.3)
mini_portile2 (2.5.1)
mini_mime (1.1.0)
mini_portile2 (2.5.3)
minitest (5.14.4)
minitest-focus (1.2.1)
minitest-focus (1.3.1)
minitest (>= 4, < 6)
mocha (1.12.0)
nio4r (2.5.7)
nokogiri (1.11.5)
nokogiri (1.11.7)
mini_portile2 (~> 2.5.0)
racc (~> 1.4)
nokogiri (1.11.5-x86_64-darwin)
nokogiri (1.11.7-x86_64-darwin)
racc (~> 1.4)
parallel (1.20.1)
parlour (6.0.0)
Expand All @@ -154,23 +106,41 @@ GEM
sorbet-runtime (>= 0.5)
parser (3.0.0.0)
ast (~> 2.4.1)
pry (0.14.0)
pry (0.14.1)
coderay (~> 1.1)
method_source (~> 1.0)
racc (1.5.2)
rack (2.2.3)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rack-test (0.6.3)
rack (>= 1.0)
rails (5.0.7.2)
actioncable (= 5.0.7.2)
actionmailer (= 5.0.7.2)
actionpack (= 5.0.7.2)
actionview (= 5.0.7.2)
activejob (= 5.0.7.2)
activemodel (= 5.0.7.2)
activerecord (= 5.0.7.2)
activesupport (= 5.0.7.2)
bundler (>= 1.3.0)
railties (= 5.0.7.2)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (5.0.7.2)
actionpack (= 5.0.7.2)
activesupport (= 5.0.7.2)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rainbow (3.0.0)
rake (13.0.3)
regexp_parser (2.1.1)
rexml (3.2.5)
rubocop (1.12.0)
rubocop (1.13.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
Expand All @@ -181,12 +151,12 @@ GEM
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.4.1)
parser (>= 2.7.1.5)
rubocop-performance (1.10.2)
rubocop (>= 0.90.0, < 2.0)
rubocop-performance (1.11.3)
rubocop (>= 1.7.0, < 2.0)
rubocop-ast (>= 0.4.0)
rubocop-shopify (2.0.1)
rubocop (~> 1.11)
rubocop-sorbet (0.6.1)
rubocop-shopify (2.1.0)
rubocop (~> 1.13)
rubocop-sorbet (0.6.2)
rubocop
ruby-progressbar (1.11.0)
smart_properties (1.15.0)
Expand All @@ -201,7 +171,7 @@ GEM
sorbet-static (0.5.6360-universal-darwin-19)
sorbet-static (0.5.6360-universal-darwin-20)
sorbet-static (0.5.6360-x86_64-linux)
spoom (1.1.0)
spoom (1.1.1)
colorize
sorbet (>= 0.5.6347)
sorbet-runtime
Expand All @@ -214,7 +184,7 @@ GEM
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
tapioca (0.4.19)
tapioca (0.4.23)
bundler (>= 1.17.3)
parlour (>= 2.1.0)
pry (>= 0.12.2)
Expand All @@ -223,13 +193,13 @@ GEM
spoom
thor (>= 0.19.2)
thor (1.1.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
thread_safe (0.3.6)
tzinfo (1.2.9)
thread_safe (~> 0.1)
unicode-display_width (2.0.0)
websocket-driver (0.7.3)
websocket-driver (0.6.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.4.2)

PLATFORMS
ruby
Expand All @@ -243,7 +213,7 @@ DEPENDENCIES
minitest-focus
mocha
packwerk!
rails!
rails (~> 5.0.7, >= 5.0.7.2)
rake
rubocop-performance
rubocop-shopify
Expand Down
7 changes: 6 additions & 1 deletion lib/packwerk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ module Packwerk
autoload :ConstNodeInspector
autoload :DependencyChecker
autoload :DeprecatedReferences
autoload :ExtractLoadableConstantDefinitions
autoload :FileProcessor
autoload :FilesForProcessing
autoload :Graph
Expand All @@ -40,10 +41,14 @@ module Packwerk
autoload :Reference
autoload :ReferenceExtractor
autoload :ReferenceOffense
autoload :ResolveConstantDefinitions
autoload :Result
autoload :RunContext
autoload :Version
autoload :ViolationType
autoload :Version
autoload :ZeitwerkOffense
autoload :ZeitwerkValidationRun
autoload :ZeitwerkViolations

module Inflections
extend ActiveSupport::Autoload
Expand Down
Loading
Loading