Repository navigation
Check each tool entry's quoting during validation (#699) - #1412
Merged
Merged
Conversation
ToolExecutor, ToolExecutorHelper and ToolValidator move to their own directory, as the file code did in filesystem/. Their unit specs move to spec/units/tools/ alongside the default tools' quoting spec. Only require paths change. DIY finds the objects through the load path the rakefile already builds from every lib/ceedling/ subdirectory. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A tool's command reaches the shell as one string. A quote that one entry leaves open pairs with a quote in a later entry, so the command's words shift. A typographic quote pasted from a web page is the usual cause, since a shell reads it as an ordinary character. The build then fails with an unrelated error such as `no input files`, or runs with corrupted paths. ToolValidator now checks :executable and every argument, hash arguments included, as each tool validates. ShellQuoting reads one entry as a shell does. A backslash escapes outside single quotes, and on Windows a single quote is ordinary. ToolQuoting walks a tool's entries and words the findings. An unclosed quote fails validation and names the entry, along with any typographic quote as its likely cause. A typographic quote in closed quoting only warns. An executable left unclosed skips the search for its file, so it reports once. Optional tools are checked too. Every built-in core and plugin tool passes with no finding, on Windows and elsewhere. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tools reference notes that each argument closes its own quotes and that a typographic quote draws a warning. The Changelog lists the check under 1.2.3's additions. Breaking Changes describes a quote that spans two arguments, which now fails validation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CI summary · 2bf5de7 · ✅ 25/25 jobs passed · nearest baseline bf3683b (master)
Diff coverage: 100.00% (54/54 changed lines).
All legs (examples / failures / pending)
Jobs
|
The quoting guard spec labeled each plugin YAML tool with File.dirname( path, 2 ). The level argument arrived in Ruby 3.1, so the spec failed to load on the Ruby 3.0 CI jobs. Nested dirname calls give the same label on every supported Ruby. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #699.
Problem
A tool's command reaches the shell as one string. A quote that one
:executableor:argumentsentry leaves open pairs with a quote in a later entry, so the command's words shift. The usual cause is a typographic quote pasted from a web page, as in-I"${5}”. A shell reads”as an ordinary character.shfails with a syntax error, and on Windows the rest of the command, source file included, is swallowed into one argument. Using custom compiler settings not working #699's gcc reportedno input files.Nothing checked a tool's quoting before this change.
Change
ToolValidator.ConfiguratorValidatoronly fetches core:toolsand hands them on. Every plugin tool, Command Hooks included, callsToolValidatordirectly, so every tool gets the check with no new call sites.ShellQuotingreads one entry as a shell does. A backslash escapes the next character outside single quotes, and Ruby#{…}expansions are skipped. On Windows,'is an ordinary character.ToolQuotingwalks the entries asToolExecutorexpands them: string arguments, plus each hash argument's first key and the strings among its values.tool_executor.rb,tool_executor_helper.rbandtool_validator.rbintolib/ceedling/tools/, and their unit specs intospec/units/tools/. Onlyrequirepaths change.Verification
🤖 Generated with Claude Code