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

Fix theme check warnings #1364

Closed
3 tasks done
andrewetchen opened this issue Feb 15, 2022 · 1 comment · Fixed by #1511
Closed
3 tasks done

Fix theme check warnings #1364

andrewetchen opened this issue Feb 15, 2022 · 1 comment · Fixed by #1511
Assignees
Labels
Severity: 2 High Severity

Comments

@andrewetchen
Copy link
Contributor

andrewetchen commented Feb 15, 2022

Describe the current behavior

This is a follow up to @charlespwd 's PR: #955

There are currently 291 offences.

  • Auto-correctable Auto-correctable theme check fixes #1371
    • 255 for Deprecated filter `img_url`, consider using `image_url`.
    • 7 for SpaceInsideBraces
    • 9 for SchemaJsonFormat
  • Requires manual changes Theme check manual fixes #1379
    • 10 for DeprecatedFilter: Deprecated filter `img_url`, consider using an alternative: `image_url`.
    • 8 for ImgLazyLoading
    • 2 for LiquidTag: Use {% liquid ... %} to write multiple tags.

Describe the expected behavior

As expected, theme-check is doing its job but the goal here is to fix these warnings.

Version information (Dawn, browsers and operating systems)

  • Dawn Version: 3.0.0
  • Chrome Version 98.0.4758.102
  • macOS Version 12.2.1

Possible solution

Use shopify theme check to auto-correct 271/291 offences and manually fix the rest.

Will create two separate PRs: one for automatic fixes and one for manual fixes.

Additional context/screenshots

Screenshots

DeprecatedFilter

image

SchemaJsonFormat

image

SpaceInsideBraces

image

LiquidTag

image

Links


Update: March 15 2022

This will need to be handled in another PR

  • sections/header.liquid: suggestion: TemplateLength: Template has too many lines [621/600].
sections/header.liquid: suggestion: TemplateLength: Template has too many lines [621/600].
@andrewetchen andrewetchen added the Severity: 2 High Severity label Feb 15, 2022
@andrewetchen andrewetchen self-assigned this Feb 15, 2022
@andrewetchen andrewetchen changed the title Update deprecated img_url filter to image_url Fix theme check warnings Feb 16, 2022
@andrewetchen
Copy link
Contributor Author

Update: March 16 2022

https://shopify.dev/themes/tools/theme-check/checks/template-length

TemplateLength:
  enabled: true
  max_length: 600
  exclude_schema: true
  exclude_stylesheet: true
  exclude_javascript: true

Code in {% schema %}, {% stylehseet %}, and {% javascript %} tags are excluded. The max_length: 600 accounts for everything else within Liquid files (Code, comments, blank lines).

Currently, only 1 theme check warning exists and its for the header.liquid template length:

sections/header.liquid: suggestion: TemplateLength: Template has too many lines [621/600].

TemplateLength of all .liquid files:

Filename Code Comments Blank Total Lines
sections/main-product.liquid 1,089 1 38 1,128
sections/header.liquid 782 0 51 833
sections/featured-product.liquid 747 0 28 775
sections/footer.liquid 593 1 23 617
sections/collapsible-content.liquid 518 0 5 523
snippets/facets.liquid 466 12 30 508
sections/slideshow.liquid 450 0 11 461
sections/image-banner.liquid 422 0 7 429
sections/image-with-text.liquid 415 0 5 420
sections/email-signup-banner.liquid 383 0 6 389
sections/multicolumn.liquid 375 0 7 382
sections/main-article.liquid 367 0 12 379
sections/collage.liquid 367 0 6 373
sections/main-search.liquid 340 0 20 360
sections/featured-collection.liquid 343 0 13 356
sections/main-cart-items.liquid 308 1 25 334
templates/customers/order.liquid 278 0 7 285
templates/customers/addresses.liquid 256 0 9 265
layout/theme.liquid 220 0 43 263
sections/collection-list.liquid 250 0 11 261
sections/product-recommendations.liquid 240 0 13 253
sections/featured-blog.liquid 234 0 9 243
sections/video.liquid 216 0 5 221
sections/newsletter.liquid 213 0 5 218
sections/main-collection-product-grid.liquid 205 0 11 216
templates/gift_card.liquid 175 0 27 202
sections/rich-text.liquid 189 0 6 195
snippets/product-thumbnail.liquid 168 21 6 195
snippets/card-product.liquid 167 17 7 191
snippets/icon-accordion.liquid 184 0 1 185
sections/contact-form.liquid 178 0 5 183
layout/password.liquid 139 0 30 169
templates/customers/login.liquid 135 0 14 149
sections/main-blog.liquid 139 0 7 146
sections/main-cart-footer.liquid 131 0 14 145
snippets/article-card.liquid 119 20 2 141
sections/page.liquid 127 0 6 133
sections/main-password-header.liquid 128 0 4 132
sections/main-password-footer.liquid 124 0 2 126
sections/main-list-collections.liquid 119 0 3 122
templates/customers/register.liquid 119 0 2 121
templates/customers/account.liquid 108 0 11 119
snippets/card-collection.liquid 90 12 3 105
snippets/product-media.liquid 84 15 4 103
templates/customers/activate_account.liquid 95 0 5 100
sections/main-collection-banner.liquid 92 1 6 99
templates/customers/reset_password.liquid 93 0 5 98
snippets/price.liquid 77 12 5 94
sections/custom-liquid.liquid 89 0 3 92
sections/announcement-bar.liquid 81 0 2 83
sections/pickup-availability.liquid 67 1 9 77
sections/main-page.liquid 57 0 6 63
sections/predictive-search.liquid 55 1 4 60
snippets/pagination.liquid 37 12 5 54
sections/cart-notification-product.liquid 50 0 1 51
snippets/meta-tags.liquid 34 0 6 40
snippets/cart-notification.liquid 25 9 2 36
sections/apps.liquid 30 0 2 32
sections/main-404.liquid 21 0 3 24
sections/cart-icon-bubble.liquid 16 0 1 17
snippets/icon-error.liquid 6 0 1 7
snippets/icon-share.liquid 5 0 1 6
snippets/icon-success.liquid 5 0 1 6
snippets/icon-zoom.liquid 5 0 1 6
snippets/icon-close-small.liquid 4 0 1 5
snippets/icon-instagram.liquid 4 0 1 5
snippets/icon-pause.liquid 4 0 1 5
snippets/icon-remove.liquid 4 0 1 5
snippets/icon-3d-model.liquid 3 0 1 4
snippets/icon-account.liquid 3 0 1 4
snippets/icon-arrow.liquid 3 0 1 4
snippets/icon-caret.liquid 3 0 1 4
snippets/icon-cart-empty.liquid 3 0 1 4
snippets/icon-cart.liquid 3 0 1 4
snippets/icon-checkmark.liquid 3 0 1 4
snippets/icon-clipboard.liquid 3 0 1 4
snippets/icon-close.liquid 3 0 1 4
snippets/icon-discount.liquid 3 0 1 4
snippets/icon-facebook.liquid 3 0 1 4
snippets/icon-filter.liquid 3 0 1 4
snippets/icon-hamburger.liquid 3 0 1 4
snippets/icon-minus.liquid 3 0 1 4
snippets/icon-padlock.liquid 3 0 1 4
snippets/icon-pinterest.liquid 3 0 1 4
snippets/icon-plus.liquid 3 0 1 4
snippets/icon-snapchat.liquid 3 0 1 4
snippets/icon-tick.liquid 3 0 1 4
snippets/icon-tiktok.liquid 3 0 1 4
snippets/icon-tumblr.liquid 3 0 1 4
snippets/icon-twitter.liquid 3 0 1 4
snippets/icon-unavailable.liquid 3 0 1 4
snippets/icon-vimeo.liquid 3 0 1 4
snippets/icon-youtube.liquid 3 0 1 4
sections/cart-live-region-text.liquid 1 0 1 2
sections/cart-notification-button.liquid 1 0 1 2
snippets/icon-play.liquid 1 0 1 2
snippets/email-signup-banner-background-mobile.liquid 1 0 0 1
snippets/email-signup-banner-background.liquid 1 0 0 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Severity: 2 High Severity
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant