Skip to content

fix(gobd_company): replace literal newline in string with \n escape#429

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/fix-gobd-syntax-stringliteral
May 28, 2026
Merged

fix(gobd_company): replace literal newline in string with \n escape#429
AdaWorldAPI merged 1 commit into
mainfrom
claude/fix-gobd-syntax-stringliteral

Conversation

@AdaWorldAPI

@AdaWorldAPI AdaWorldAPI commented May 28, 2026

Copy link
Copy Markdown
Owner

Summary

Tiny fix for a SyntaxError CodeRabbit flagged as a "duplicate" thread in its final PR #426 review at b3fc9c79 — the thread remained unresolved through merge.

gobd_company.py:51 had a literal newline embedded inside a string literal:

body_source = "
".join(body_lines)

This is invalid Python — ast.parse(...) raises SyntaxError. The smoke test on uom didn't catch it because the smoke test exercises only the ORM (ast) extraction path; gobd_company.py is only imported by the data CLI subcommand on l10n_de.

Fix:

body_source = "\n".join(body_lines)

The intended single-char newline escape.

Verification

$ python3 -c "import ast; ast.parse(open('tools/.../gobd_company.py').read()); print('OK')"
OK — gobd_company.py parses

$ python tests/test_smoke_uom.py
Audit: {'other_fields': 0, 'helper_methods': 6, 'skipped_classes': 0, 'total': 6}
ALL TESTS PASS

Test plan

  • python -m ast parses the file
  • tests/test_smoke_uom.py PASS (no regression)
  • Manual python -m odoo_blueprint_extractor data --addon l10n_de --out - end-to-end (the path that was broken)

https://claude.ai/code/session_017gZ6sPRXYPj5n7uJ7NBtRv


Generated by Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Fixed method body inspection in company wiring verification to correctly detect required elements.

Review Change Stack

…CodeRabbit P1)

PR #426's `body_source = "<literal newline>".join(body_lines)` was a
SyntaxError that escaped the smoke test because the smoke test only
exercises uom (the ORM-only path), not l10n_de's data extractor.

CodeRabbit flagged this in the final review at `b3fc9c79` as a
"duplicate" comment carried forward; it remained unresolved through
merge. Fix: `"\n".join(body_lines)` — the intended one-char escape.

Now `python -m ast` parses gobd_company.py cleanly. Smoke test still
passes (no regression).

https://claude.ai/code/session_017gZ6sPRXYPj5n7uJ7NBtRv
@coderabbitai

coderabbitai Bot commented May 28, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8dc1efb2-559a-411b-87b5-6a1581350f91

📥 Commits

Reviewing files that changed from the base of the PR and between 6797e54 and 0b6447e.

📒 Files selected for processing (1)
  • tools/odoo-blueprint-extractor/odoo_blueprint_extractor/data_extractors/gobd_company.py

📝 Walkthrough

Walkthrough

This PR fixes string concatenation in the GOBD company data extractor. The _find_compute_method function now correctly joins method body lines with newline characters, ensuring proper text formatting for downstream trigger substring verification.

Changes

Method Body Inspection String Join Fix

Layer / File(s) Summary
Fix body_source string construction
tools/odoo-blueprint-extractor/odoo_blueprint_extractor/data_extractors/gobd_company.py
Line 51 corrects how body_lines are joined from an incorrect string-literal approach to "\n".join(...), ensuring method body text is properly inspected for trigger substrings.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A newline joins the body lines with care,
No more string literals floating in air,
The method breathes with \n between each phrase,
Triggers found now in substring maze!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fix-gobd-syntax-stringliteral

Comment @coderabbitai help to get the list of available commands and usage tips.

@AdaWorldAPI AdaWorldAPI merged commit da1e02e into main May 28, 2026
1 check was pending
AdaWorldAPI added a commit that referenced this pull request May 28, 2026
…gliteral

fix(gobd_company): replace literal newline in string with \n escape
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants