Repository navigation
fix(parser): accept env with redirections and no command - #1209
Open
chuenchen309 wants to merge 1 commit into
Open
chuenchen309 wants to merge 1 commit into
chuenchen309 wants to merge 1 commit into
Conversation
env reads its options with the same helper as command (NVIDIA#1173), so env > file completes inspection while a command after the redirection is still inspected. Signed-off-by: chuenchen309 <48723787+chuenchen309@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#1173 taught the
commandbuiltin to read redirections between its options and the executable, socommand > /tmp/x.txtcompletes inspection.envhas the same commandless form and still reads its next word withnext_word(), so a script that dumps its environment is reported asstatic_parse_limit/command_word_boundaryand the scan stays partial:This change reads
envoptions, and the word afterenv --, with the samenext_command_word()helper. Redirection targets are consumed and the executable after them is still inspected:env >output rm -rf /still reports TM1, andenv >log bash -c "$CMD",env >and an incomplete target stay partial. A<or>attached to the previous word, as in the documentation placeholderenv FILE=<config> process, still goes throughnext_word(), so the existing placeholder diagnostics are unchanged. Unknown options such asenv -0still fail closed.Validation
test_command_wrapper_without_command.pytoenv,env -i,env --andenv NAME=value. Twelve of the new cases fail onmain(02894ec5); the file's 235 tests pass here.not integration and not provider): 27,281 passed, 28 skipped, 4 xfailed.skillspector scan <skill> --no-llm --format jsonon a skill whose script runsenv > /tmp/env.txtreportsanalysis_completeness.status: partialonmainandcompletehere.ruff check src/ tests/andruff format --check src/ tests/pass.Integration, live-provider, Docker and native Windows checks were not run locally.