Skip to content

fix: report a path with no .prql files in every prqlc command - #6587

Open
prql-bot wants to merge 6 commits into
mainfrom
fix/cli-no-prql-sources
Open

prql-bot wants to merge 6 commits into
mainfrom
fix/cli-no-prql-sources

Conversation

@prql-bot

Copy link
Copy Markdown
Collaborator

prqlc fmt query.txt exited 0 and left the file untouched, because the CLI only reads files with a .prql extension and fmt had nothing to check that against. With an empty directory, prqlc lex reported Currently `lex` only works with a single source, but found multiple sources, and debug annotate and experimental highlight gave the same message for zero sources. read_files now returns Error: No .prql files found in <path> when it finds no .prql files, so every path-reading command reports the same thing, and fmt exits 1.

compile already failed in this case with No `.prql` files found in the source tree. Its message now names the path, which updates the compile_no_prql_files snapshot. Stdin input is unaffected: prqlc compile - with no input still reports No PRQL query entered.

The new no_prql_files CLI test covers fmt on a .txt file, including that the file is unchanged, and lex on an empty directory. Both fail on main. cargo insta test -p prqlc --bin prqlc passes.

Found by the nightly code survey.

prql-bot and others added 3 commits November 20, 2026 06:58
prqlc fmt on a file without a .prql extension, or a directory with no
.prql files, exited successfully without doing anything, and lex,
debug annotate and highlight said they found multiple sources. Report
that no .prql files were found, naming the path, from read_files.

This branch has not been deployed

No deployments
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.

1 participant