rs-parsepatch misses some diffs
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 50/100
Research direction
Start by running the Python reproduction against rs_parsepatch.get_diffs with the supplied patch and confirm that it yields 2 instead of 3. Trace how get_diffs handles the two files and their hunks, then verify that the corrected behavior reports all 3 diffs.
Written by the indexing model from the issue text.
Description
Assuming that variable path is a patch defined in the following python code:
import rs_parsepatch
patch = """
--- a/js/src/vm/Printer.cpp 2023-06-20 15:04:32.907323769 +0000
+++ b/js/src/vm/Printer.cpp 2023-06-20 15:05:18.491323769 +0000
@@ -52,7 +52,7 @@
}
bool GenericPrinter::put(mozilla::Span<const char16_t> str) {
- for (char16_t c: str) {
+ for (char16_t c : str) {
if (!putChar(c)) {
return false;
}
@@ -245,7 +245,7 @@
return false;
}
- for (char16_t c: str) {
+ for (char16_t c : str) {
MOZ_ASSERT(IsAsciiPrintable(c));
*bp++ = char(c);
}
--- a/js/src/vm/BytecodeUtil.cpp 2023-06-20 15:04:32.907323769 +0000
+++ b/js/src/vm/BytecodeUtil.cpp 2023-06-20 15:05:18.439323769 +0000
@@ -2308,9 +2308,7 @@
MOZ_CRASH("No binding");
}
-UniqueChars ExpressionDecompiler::getOutput() {
- return sprinter.release();
-}
+UniqueChars ExpressionDecompiler::getOutput() { return sprinter.release(); }
} // anonymous namespace
"""
diffs = 0
for diff in rs_parsepatch.get_diffs(patch):
diffs += 1
print(diffs)
Expected behaviour would be to have printed out 3 but in this case we have 2, which is wrong.
This has been tested and reproduced on the latest version: 0.3.9
- Dominant language
- Rust
- Stars
- 8
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from mozilla/pyo3-parsepatch
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
mozilla/pyo3-parsepatch#44 · 1 comment ·
-
Support alpine Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
mozilla/pyo3-parsepatch#16 ·
All issues in mozilla/pyo3-parsepatch
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100