HardcodedRoutes flags paths that only share a prefix with a route
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 20/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- typescript
- Lĩnh vực
- tooling
Hướng nghiên cứu
Start by locating the HardcodedRoutes rule in the theme-tools repository and read how it matches route paths against the Liquid examples in the issue. Check the rule's existing tests for prefix matching and add coverage for the reported paths. Done means only actual route paths are reported, including /collections/all-shoes as /collections; pull request #1363 is already open for this issue.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the bug
HardcodedRoutes matches routes with a plain string prefix. Any path that starts with the same characters as a route is reported, even when it is a different page. For /collections/all-shoes, the check suggests routes.all_products_collection_url, which points to a different page.
Source
<a href="/cartography"></a>
<a href="/searching"></a>
<a href="/accounting"></a>
{{ 'Carts' | link_to: '/carts' }}
<a href="/collections/all-shoes"></a>
Expected behaviour
No offense for /cartography, /searching, /accounting and /carts. /collections/all-shoes is reported as /collections with routes.collections_url.
Actual behaviour
/cartography: "Use routes object {{ routes.cart_url }} instead of hardcoding /cart"/searching: "Use routes object {{ routes.search_url }} instead of hardcoding /search"/accounting: "Use routes object {{ routes.account_url }} instead of hardcoding /account"/carts: "Use routes object {{ routes.cart_url }} instead of hardcoding /cart"/collections/all-shoes: "Use routes object {{ routes.all_products_collection_url }} instead of hardcoding /collections/all"
Debugging information
- Theme Check version:
@shopify/theme-check-commononmain(3f810a1)
- Ngôn ngữ chính
- TypeScript
- Star
- 240
- Fork
- 106
- Merge trung bình
- 2 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 18
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Shopify/theme-tools
-
CdnPreconnect misses `href="https://cdn.shopify.com"` without a trailing pathCó thể đã có người làm @RaphaelFakhri đã nhận 9 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Shopify/theme-tools#1365 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
theme-graph CLI never calls getWebComponentMap, so custom-element references are never resolvedCó thể đã có người làm @reginaldalfret đã nhận 27 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
Shopify/theme-tools#1291 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
JSONMissingBlock false positive for app block when section supports both @app and @themeCó thể đã có người làm @chippleh1392 đã nhận 144 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Shopify/theme-tools#1144 · 2 bình luận · 8 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Theme Check ignores `.theme-check.yml` ignore patterns when the theme is inside a dot-directoryCó thể đã có người làm @diogochaves đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
Shopify/theme-tools#1374 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
Shopify/theme-tools#1367 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Shopify/theme-tools
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Northeastern-Electric-Racing/FinishLine#4660 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
excaliburjs/Excalibur#3895 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
infer_audio_type only recognises one MPEG Layer III frame header, so most MP3 files are rejectedCó thể đã có người làm @Steve-20-ai đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Earn report crashes with "RangeError: Invalid time value" when a report row has an unparsable timestampCó thể đã có người làm @Gurkaran18 đã nhận hôm nay. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
joinmarket-webui/jam#1588 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
BeOS .json missingĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
mihaip/infinite-mac#475 ·