[bug] Using the historical ./
path prefix to files
breaks file discovery
#1530
Labels
bug
Something isn't working
./
path prefix to files
breaks file discovery
#1530
Please read the FAQ for the bug you encountered.
⏯ Playground Link
https://ast-grep.github.io/playground.html#eyJtb2RlIjoiQ29uZmlnIiwibGFuZyI6InJ1c3QiLCJxdWVyeSI6ImNvbnNvbGUubG9nKCRNQVRDSCkiLCJyZXdyaXRlIjoibG9nZ2VyLmxvZygkTUFUQ0gpIiwic3RyaWN0bmVzcyI6InNtYXJ0Iiwic2VsZWN0b3IiOiIiLCJjb25maWciOiJpZDogdGVzdFxuc2V2ZXJpdHk6IHdhcm5pbmdcbmxhbmd1YWdlOiBSdXN0XG5cbmZpbGVzOlxuICAtIFwiLi8qKi8qLnJzXCJcblxucnVsZTpcbiAga2luZDogaW50ZWdlcl9saXRlcmFsIiwic291cmNlIjoiZm4gZigpIHtcbiAgICBnKDEyMyk7XG59XG4ifQ==
💻 Code
Example Rust file under
a/b.rs
:Non-matching rule under
rule.yml
:Matching rule:
🙁 Actual behavior
When running
ast-grep scan -r rule.yml
from the directory containinga
, nothing is matched and no output is printed. When running the rule with the./
removed from the file path glob, the discovery works again and a match is output:🙂 Expected behavior
Both rule versions should now be identical and emit the same matches, or at least the
./
prefix should be outright refused, otherwise any analysis using the historically-enforced path prefix becomes entirely silent without notice.Additional information about the issue
files
attribute is completely ignored: usingfile: - "whateveridontexist"
still matches just fine; only locally will it occur.The text was updated successfully, but these errors were encountered: