Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

theme-check seems to have just completely stopped responding. #247

Closed
ConduciveMammal opened this issue Apr 8, 2021 · 6 comments · Fixed by #249
Closed

theme-check seems to have just completely stopped responding. #247

ConduciveMammal opened this issue Apr 8, 2021 · 6 comments · Fixed by #249
Labels
bug Something isn't working

Comments

@ConduciveMammal
Copy link

So I opened a new project folder in VSCode and noticed theme-check wasn't kicking in. I triggered Theme Check: Restart Server, it didn't do anything, no messages, no loading, just nothing.

So then I went to terminal and opened a project folder I knew it previously worked in and ran theme-check.
I then get:

theme-check
Checking src/theme ...

It hangs there, not doing anything. If I Cmd+C to quit, it shows this log:

^C/usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/lib/theme_check/regex_helpers.rb:8:in `match': Interrupt
        from /usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/lib/theme_check/regex_helpers.rb:8:in `match'
        from /usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/lib/theme_check/regex_helpers.rb:8:in `matches'
        from /usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/lib/theme_check/checks/img_width_and_height.rb:28:in `record_offenses'
        from /usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/lib/theme_check/checks/img_width_and_height.rb:22:in `on_document'
        from /usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/lib/theme_check/checks.rb:7:in `block in call'
        from /usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/lib/theme_check/checks.rb:5:in `each'
        from /usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/lib/theme_check/checks.rb:5:in `call'
        from /usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/lib/theme_check/visitor.rb:37:in `call_checks'
        from /usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/lib/theme_check/visitor.rb:21:in `visit'
        from /usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/lib/theme_check/visitor.rb:10:in `visit_template'
        from /usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/lib/theme_check/analyzer.rb:31:in `block in analyze_theme'
        from /usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/lib/theme_check/analyzer.rb:31:in `each'
        from /usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/lib/theme_check/analyzer.rb:31:in `analyze_theme'
        from /usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/lib/theme_check/cli.rb:113:in `check'
        from /usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/lib/theme_check/cli.rb:73:in `run'
        from /usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/lib/theme_check/cli.rb:77:in `run!'
        from /usr/local/Cellar/theme-check/0.6.0/gems/theme-check-0.6.0/exe/theme-check:6:in `<top (required)>'
        from /usr/local/bin/theme-check:6:in `load'
        from /usr/local/bin/theme-check:6:in `<main>'

I then tried reinstalling the theme-check brew and get shown this message a few times:

❯ brew reinstall theme-check
Warning: Calling `def fetch` in a subclass of `Formulary::FormulaNamespaceeb7b122968da77c64c30f8a803c0134c::ThemeCheck::RubyGemsDownloadStrategy` is deprecated! Use `def fetch(timeout: nil, **options)` and output a warning when `options` contains new unhandled options instead.
Please report this issue to the shopify/shopify tap (not Homebrew/brew or Homebrew/core), or even better, submit a PR to fix it:
  /usr/local/Homebrew/Library/Taps/shopify/homebrew-shopify/theme-check.rb:16

==> Fetching theme-check from gem source
Downloaded theme-check-0.6.0
==> Reinstalling shopify/shopify/theme-check 
Warning: Calling `def fetch` in a subclass of `Formulary::FormulaNamespaceeb7b122968da77c64c30f8a803c0134c::ThemeCheck::RubyGemsDownloadStrategy` is deprecated! Use `def fetch(timeout: nil, **options)` and output a warning when `options` contains new unhandled options instead.
Please report this issue to the shopify/shopify tap (not Homebrew/brew or Homebrew/core), or even better, submit a PR to fix it:
  /usr/local/Homebrew/Library/Taps/shopify/homebrew-shopify/theme-check.rb:16

==> /usr/local/opt/ruby/bin/gem install /Users/liammerlyn/Library/Caches/Homebrew/theme-check-0.6.0.gem --no-document --no-wrapper --no-user-install --install-dir /usr/local/Cellar/theme-check/0.6.0 --bindir /usr/local/Cellar/theme-che
Warning: Calling `def fetch` in a subclass of `Formulary::FormulaNamespaceeb7b122968da77c64c30f8a803c0134c::ThemeCheck::RubyGemsDownloadStrategy` is deprecated! Use `def fetch(timeout: nil, **options)` and output a warning when `options` contains new unhandled options instead.
Please report this issue to the shopify/shopify tap (not Homebrew/brew or Homebrew/core), or even better, submit a PR to fix it:
  /usr/local/Homebrew/Library/Taps/shopify/homebrew-shopify/theme-check.rb:16

I also tried restarting my system, VSCode and reinstalling the VSCode extension.

It just... Died 😓 .

@macournoyer macournoyer added the bug Something isn't working label Apr 8, 2021
@macournoyer
Copy link
Contributor

Damn! I couldn't reproduce with any of our themes.

@charlespwd I think it hangs on the IMG_TAG regex in ImgWidthAndHeight. I suggest we disable that check by default for now.

@ConduciveMammal
Copy link
Author

Huh! Disabling that did the trick perfectly! Thanks!

Weird how that feature previously worked and then just... Imploded, ha!

@charlespwd
Copy link
Contributor

I'd love to figure out what caused it :P It's definitely some kind of infinite/slow regex. Would love to find out what kind of code made it trip.

@macournoyer
Copy link
Contributor

@ConduciveMammal if by any chance you've got the diff that started causing this 😄

@andershagbard
Copy link

I am still experiencing this exact issue. Not sure what code it gets stuck in.

@charlespwd
Copy link
Contributor

charlespwd commented Apr 22, 2021

Hey @andershagbard, it seems like the RemoteAsset check is causing issue. You can turn disable this check in your .theme-check.yml until we figure out what's wrong with it.

If, it's not too much to ask, would it be possible to grab a copy of your theme for debugging purposes?

A zip of your theme sent at [email protected] would be very helpful!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
4 participants