Skip to content

identity-literals crashes on valid Rust unicode escape literals #88

Description

@randlee

Problem

sc-lint v0.4.0 identity-literals crashes instead of returning a lint result when a Rust source line contains a valid Rust unicode escape such as \\u{feff}.

The Python utility decodes matched Rust string contents with Python unicode_escape; Rust brace-form escapes are not valid Python \\uXXXX escapes, so the adapter returns CLI.BACKEND_EXEC_FAILURE.

Reproducer

Run identity-literals against a clean consumer containing a valid Rust string literal such as:

let bom = "\\u{feff}";

Observed error:

failed to evaluate identity literals: unicodeescape codec cant decode bytes ... truncated \\uXXXX escape

Impact

The sc-compose CI workaround for sc-lint issue #84 must temporarily skip identity-literals. This issue is separate from #84, which covers full/ci profile boundary and portability dispatch.

Requested fix

Parse Rust string escapes according to Rust syntax, or otherwise preserve brace-form unicode escapes without crashing. Return the stable sc-lint-python-v1 JSON envelope and add a regression test. A released sc-lint version must pass identity-literals from a clean external consumer before downstream CI restores the full profile.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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