Skip to content

fix: update fypp linemarker-resync patch header for fypp 3.2#1439

Merged
sbryngelson merged 2 commits into
MFlowCode:masterfrom
sbryngelson:fix/fypp-linemarker-patch-header
May 15, 2026
Merged

fix: update fypp linemarker-resync patch header for fypp 3.2#1439
sbryngelson merged 2 commits into
MFlowCode:masterfrom
sbryngelson:fix/fypp-linemarker-patch-header

Conversation

@sbryngelson
Copy link
Copy Markdown
Member

Summary

The fypp linemarker-resync patch (added in #1436) was written against an older fypp version where the target hunk began at line 1842 with @@ -1842,11 +1842,16 @@. In fypp 3.2 the same code sits at line 1848 and the surrounding context is smaller, so patch rejects the file as malformed and emits a warning on every mfc.sh invocation:

WARNING > (venv) Failed to apply fypp linemarker-resync patch (fypp version may have changed).

The patch header has been regenerated directly from the installed fypp 3.2 source, producing the correct @@ -1848,7 +1848,13 @@ counts. The actual change to fypp (adding or True to always emit resync linemarkers after single-line $: calls) is identical.

Test plan

  • patch applies cleanly against fypp 3.2 with no error
  • grep "Always emit a resync marker" $FYPP_PY confirms the patch is active
  • No startup warning on ./mfc.sh invocations
  • ./mfc.sh precheck passes (all 6 checks)

The original patch was written against an older fypp version where
the target hunk began at line 1842 with 11 old / 16 new lines. In
fypp 3.2 the same code sits at line 1848 and the hunk is smaller
(7 old / 13 new), causing 'patch' to reject the file as malformed
and emit a startup warning on every mfc.sh invocation.

Regenerated the patch directly from the installed fypp 3.2 source.
The actual change (adding 'or True' to always emit resync linemarkers
after single-line $: calls) is identical.
@github-actions
Copy link
Copy Markdown

Claude Code Review

Head SHA: d2c3a8d

Files changed:

  • 1
  • toolchain/patches/fypp-linemarker-resync.patch

Findings

or True makes unsync/multiline dead code in the condition

toolchain/patches/fypp-linemarker-resync.patch, changed hunk:

-                if unsync or multiline:
+                if unsync or multiline or True:

or True makes the condition unconditionally True, so the unsync and multiline sub-expressions are never evaluated and serve no purpose. This is effectively dead code in the guard. The comment correctly states the intent ("always emit a resync marker"), but the implementation is inconsistent with it: if the desired behavior is unconditional, the if check should either be removed entirely or written as a clearly-named boolean (always_resync = True) so future patch maintainers don't have to reason through why the condition is always true despite the two meaningful-looking operands.

The risk is that a future maintainer who doesn't notice the or True might "simplify" the condition by removing it, silently regressing the fix. It also means any future upstream change that affects unsync or multiline will have no effect on this code path, which could obscure upgrade conflicts.

The correct minimal patch would be to either omit the if entirely (just run the block unconditionally) or replace the whole condition with if True: to make the intent explicit.

Addressed code review feedback: 'if unsync or multiline or True'
makes the unsync/multiline sub-expressions dead code. Since the
intent is to always emit a resync linemarker after a $: call,
remove the if guard entirely and dedent the body, making the
unconditional behaviour explicit in the code rather than hiding
it behind a tautological condition.
@sbryngelson sbryngelson marked this pull request as ready for review May 15, 2026 00:16
@qodo-code-review
Copy link
Copy Markdown
Contributor

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@sbryngelson sbryngelson merged commit f85f7fa into MFlowCode:master May 15, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant