Skip to content

Format KW macro keyword invocations onto separate lines in reserved_keywords unit test#18

Merged
nunoplopes merged 2 commits intomasterfrom
copilot/refactor-macro-invocations
Apr 20, 2026
Merged

Format KW macro keyword invocations onto separate lines in reserved_keywords unit test#18
nunoplopes merged 2 commits intomasterfrom
copilot/refactor-macro-invocations

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

The KW macro in tests/unit/reserved_keywords.cpp had multiple X(...) invocations compressed onto one line, which made the keyword list harder to scan and debug. This updates the definition to use one invocation per line, matching the surrounding style.

  • Macro formatting consistency

    • Expanded the final grouped sequence in KW(X) so each keyword uses its own continued line.
    • No semantic or behavioral changes; this is a readability/maintainability refactor in test code.
  • Updated section

    • Reformatted:
      • X(override) X(priv) X(unsized) X(yield) X(macro_rules) X(raw) X(safe) X(vec)
    • Into:
X(override)                                                                  \
X(priv)                                                                      \
X(unsized)                                                                   \
X(yield)                                                                     \
X(macro_rules)                                                               \
X(raw)                                                                       \
X(safe)                                                                      \
X(vec)
Original prompt
Please apply the following diffs and create a pull request.
Once the PR is ready, give it a title based on the messages of the fixes being applied.

[{"message":"Multiple macro invocations on a single line reduces readability and makes debugging more difficult. Consider placing each X() invocation on a separate line for consistency with the rest of the KW macro definition.","fixFiles":[{"filePath":"tests/unit/reserved_keywords.cpp","diff":"diff --git a/tests/unit/reserved_keywords.cpp b/tests/unit/reserved_keywords.cpp\n--- a/tests/unit/reserved_keywords.cpp\n+++ b/tests/unit/reserved_keywords.cpp\n@@ -33,7 +33,14 @@\n   X(final)                                                                     \\\n   X(gen)                                                                       \\\n   X(macro)                                                                     \\\n-  X(override) X(priv) X(unsized) X(yield) X(macro_rules) X(raw) X(safe) X(vec)\n+  X(override)                                                                  \\\n+  X(priv)                                                                      \\\n+  X(unsized)                                                                   \\\n+  X(yield)                                                                     \\\n+  X(macro_rules)                                                               \\\n+  X(raw)                                                                       \\\n+  X(safe)                                                                      \\\n+  X(vec)\n \n // Field declaration\n #define F(n) int n;\n"}]}]

Agent-Logs-Url: https://github.com/Cpp2Rust/cpp2rust/sessions/45d5e81b-9441-4cf4-acc7-9e4448914947

Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>
Copilot AI changed the title [WIP] Refactor macro invocations for improved readability Format KW macro keyword invocations onto separate lines in reserved_keywords unit test Apr 20, 2026
Copilot AI requested a review from nunoplopes April 20, 2026 07:52
@nunoplopes nunoplopes marked this pull request as ready for review April 20, 2026 08:07
@nunoplopes nunoplopes merged commit 2498fbc into master Apr 20, 2026
16 of 17 checks passed
@nunoplopes nunoplopes deleted the copilot/refactor-macro-invocations branch April 20, 2026 08:08
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