Skip to content

Fix RemoteAsset false positives for hash URLs and variable lookups#1121

Merged
charlespwd merged 1 commit intomainfrom
fix-remote-asset-false-positives
Feb 5, 2026
Merged

Fix RemoteAsset false positives for hash URLs and variable lookups#1121
charlespwd merged 1 commit intomainfrom
fix-remote-asset-false-positives

Conversation

@charlespwd
Copy link
Contributor

Summary

Fixes #995, Fixes #982

This PR fixes two false positive issues in the RemoteAsset check:

  1. Hash URLs (#anchor, #section) were incorrectly flagged as remote assets
  2. Variable-based URLs (like video_source.url) were incorrectly flagged when static analysis can't determine what's in the variable

Changes

  • Add isHashUrl() helper to detect hash-only URLs and skip linting them
  • Add startsWithVariableLookup() check to skip linting when attribute values start with a VariableLookup (since we can't statically know what's in variables)
  • Add comprehensive test cases for both patterns

Test plan

  • Added unit tests for hash URL patterns
  • Added unit tests for variable lookup patterns
  • Existing tests continue to pass

@charlespwd charlespwd marked this pull request as ready for review February 5, 2026 17:19
@charlespwd charlespwd requested a review from a team as a code owner February 5, 2026 17:19
@charlespwd
Copy link
Contributor Author

PR looks good.

Copy link
Contributor

@graygilmore graygilmore left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of comments to remove but the changes seem reasonable!

@charlespwd
Copy link
Contributor Author

I'll make sure to update my best practices to chill on the comments :D

@charlespwd charlespwd force-pushed the fix-remote-asset-false-positives branch from c74d631 to 496f1bb Compare February 5, 2026 19:43
- Add isHashUrl() helper to detect hash-only URLs and skip linting them
- Add startsWithVariableLookup() check to skip linting when attribute
  values start with a VariableLookup (can't statically resolve variables)
- Add test cases for both patterns

Fixes #995, Fixes #982

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@charlespwd charlespwd force-pushed the fix-remote-asset-false-positives branch from db6a989 to 80bb346 Compare February 5, 2026 19:59
@charlespwd charlespwd merged commit 346cc15 into main Feb 5, 2026
8 checks passed
@charlespwd charlespwd deleted the fix-remote-asset-false-positives branch February 5, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RemoteAsset shouldn't throw for video_source.url RemoteAsset shouldn't throw for hash URLs

2 participants