Print paths with forward slashes on every platform - #816
Conversation
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
|
This pull request is abnormally large and would use a significant amount of tokens to review. If you still wish to review it, comment "augment review" and we will review it. |
There was a problem hiding this comment.
All reported issues were addressed
Note: This PR contains a large number of files. cubic only reviews up to 400 files per PR, so some files may not have been reviewed. cubic prioritizes the most important files to review.
Re-trigger cubic
There was a problem hiding this comment.
1 issue found across 139 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="test/install/fail_frozen_path_mismatch.clitest">
<violation number="1" location="test/install/fail_frozen_path_mismatch.clitest:43">
P3: The `REPLACE` command treats its pattern as a regular expression (scripts/clitest.py compiles `self.expand(pattern)` with `re.compile(... re.MULTILINE)`). Expanding `$CWD_URI` directly into that pattern means the sandbox path is interpreted as regex metacharacters: if the sandbox path ever contains a `+`, `(`, `)`, `[`, `]`, `*`, `?`, or `.` it will fail to match (or match the wrong substring) and the test will break for reasons unrelated to the CLI output. The previous code deliberately escaped the brackets (`\[CWD\]`), and dropping that escaping here makes the assertion fragile. Escape the expanded path before compiling, or match on a literal string instead.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| REPLACE '\\\\' WITH '/' IN result_0.txt | ||
| REPLACE '\\(?!")' WITH '/' IN result_0.txt | ||
|
|
||
| REPLACE $CWD_URI WITH '[CWD_URI]' IN result_0.txt |
There was a problem hiding this comment.
P3: The REPLACE command treats its pattern as a regular expression (scripts/clitest.py compiles self.expand(pattern) with re.compile(... re.MULTILINE)). Expanding $CWD_URI directly into that pattern means the sandbox path is interpreted as regex metacharacters: if the sandbox path ever contains a +, (, ), [, ], *, ?, or . it will fail to match (or match the wrong substring) and the test will break for reasons unrelated to the CLI output. The previous code deliberately escaped the brackets (\[CWD\]), and dropping that escaping here makes the assertion fragile. Escape the expanded path before compiling, or match on a literal string instead.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/install/fail_frozen_path_mismatch.clitest, line 43:
<comment>The `REPLACE` command treats its pattern as a regular expression (scripts/clitest.py compiles `self.expand(pattern)` with `re.compile(... re.MULTILINE)`). Expanding `$CWD_URI` directly into that pattern means the sandbox path is interpreted as regex metacharacters: if the sandbox path ever contains a `+`, `(`, `)`, `[`, `]`, `*`, `?`, or `.` it will fail to match (or match the wrong substring) and the test will break for reasons unrelated to the CLI output. The previous code deliberately escaped the brackets (`\[CWD\]`), and dropping that escaping here makes the assertion fragile. Escape the expanded path before compiling, or match on a literal string instead.</comment>
<file context>
@@ -40,33 +40,33 @@ COPY project/jsonschema.lock.json TO lock_before.json
// Validation failure
RUN install --frozen STDIN /dev/null IN project INTO result_0.txt EXPECTING 2
+REPLACE $CWD_URI WITH '[CWD_URI]' IN result_0.txt
REPLACE $CWD WITH '[CWD]' IN result_0.txt
-REPLACE 'file:///\[CWD\]' WITH 'file://[CWD]' IN result_0.txt
</file context>
Signed-off-by: Juan Cruz Viotti jv@jviotti.com