Skip to content

loq baseline should escape brackets in paths #46

@zzstoatzz

Description

@zzstoatzz

problem

When using loq baseline on a codebase with SvelteKit-style dynamic routes (e.g., [id], [handle], [slug]), the generated rules don't match the files.

reproduction

  1. Have files like:

    • frontend/src/routes/track/[id]/+page.svelte
    • frontend/src/routes/u/[handle]/+page.svelte
  2. Run loq baseline

  3. Generated rules look like:

    [[rules]]
    path = "frontend/src/routes/track/[id]/+page.svelte"
    max_lines = 1667
  4. Run loq check - these files still show as violations

workaround

Manually escape brackets:

[[rules]]
path = "frontend/src/routes/track/\\[id\\]/+page.svelte"
max_lines = 1667

This pattern is common in SvelteKit, Next.js, and other frameworks that use bracket syntax for dynamic routes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions