Skip to content

odb: Use snake_case for LEF58 cut rules parser variables (#2275)#9722

Merged
eder-matheus merged 4 commits intoThe-OpenROAD-Project:masterfrom
Divinesoumyadip:fix-2275-part3
Mar 12, 2026
Merged

odb: Use snake_case for LEF58 cut rules parser variables (#2275)#9722
eder-matheus merged 4 commits intoThe-OpenROAD-Project:masterfrom
Divinesoumyadip:fix-2275-part3

Conversation

@Divinesoumyadip
Copy link
Contributor

Description

This PR continues the refactoring effort for issue #2275. It updates the Boost.Spirit qi::rule variable names from SCREAMING_SNAKE_CASE to standard snake_case in several LEF58 parser files. This ensures compliance with the Google C++ Style Guide and improves internal consistency within the odb module.

Files Modified

src/odb/src/lefin/ArraySpacingParser.cpp
src/odb/src/lefin/KeepOutZoneParser.cpp
src/odb/src/lefin/lefTechLayerCutEnclosureParser.cpp
src/odb/src/lefin/lefTechLayerCutSpacingParser.cpp
src/odb/src/lefin/lefTechLayerCutSpacingTableParser.cpp

Testing

Successful local build using make. And passed all OpenDB integration tests via ctest -R odb .

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully refactors the Boost.Spirit parser rule variables to use snake_case, improving consistency with the Google C++ Style Guide. However, the automatic reformatting for long lines has introduced some unconventional and inconsistent code styles. My review includes specific suggestions to improve the formatting for better readability and maintainability.

Comment on lines +314 to +315
bool valid
= qi::phrase_parse(first, last, enclosure_rule, space) && first == last;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This line break before the assignment operator is unconventional and harms readability. It's better to keep the declaration and assignment on one line. If the line is too long, it should be broken after an operator like &&, which is the pattern used in other files in this PR.

  bool valid = qi::phrase_parse(first, last, enclosure_rule, space) && first == last;

Comment on lines +414 to 416
qi::rule<std::string::const_iterator, space_type>
parallel_within_cut_class_rule
= (lit("CUTCLASS")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This formatting is unconventional. A more standard way to break long declaration lines is to place the = on the same line as the variable name and indent the following lines.

Suggested change
qi::rule<std::string::const_iterator, space_type>
parallel_within_cut_class_rule
= (lit("CUTCLASS")
qi::rule<std::string::const_iterator, space_type>
parallel_within_cut_class_rule =
(lit("CUTCLASS")

Comment on lines +409 to 411
qi::rule<std::string::const_iterator, space_type>
non_opposite_enclosure_spacing_rule
= (lit("NONOPPOSITEENCLOSURESPACING")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This formatting is unconventional. A more standard way to break long declaration lines is to place the = on the same line as the variable name and indent the following lines.

Suggested change
qi::rule<std::string::const_iterator, space_type>
non_opposite_enclosure_spacing_rule
= (lit("NONOPPOSITEENCLOSURESPACING")
qi::rule<std::string::const_iterator, space_type>
non_opposite_enclosure_spacing_rule =
(lit("NONOPPOSITEENCLOSURESPACING")

Comment on lines 415 to 417
qi::rule<std::string::const_iterator, space_type>
OPPOSITEENCLOSURERESIZESPACING
opposite_enclosure_resize_spacing_rule
= (lit("OPPOSITEENCLOSURERESIZESPACING")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This formatting is unconventional. A more standard way to break long declaration lines is to place the = on the same line as the variable name and indent the following lines.

Suggested change
qi::rule<std::string::const_iterator, space_type>
OPPOSITEENCLOSURERESIZESPACING
opposite_enclosure_resize_spacing_rule
= (lit("OPPOSITEENCLOSURERESIZESPACING")
qi::rule<std::string::const_iterator, space_type>
opposite_enclosure_resize_spacing_rule =
(lit("OPPOSITEENCLOSURERESIZESPACING")

@eder-matheus
Copy link
Member

@Divinesoumyadip Notice that you added the same changes in this PR that you already applied here: #9721.

This can conflict if we merge #9721 first, so please be sure to not mix things up in different PRs.

Signed-off-by: Divinesoumyadip <soumyacode7@gmail.com>
@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@eder-matheus
Copy link
Member

@Divinesoumyadip please look at the conflicts with master.

@Divinesoumyadip
Copy link
Contributor Author

@Divinesoumyadip please look at the conflicts with master.

Thanks, @eder-matheus ,I'm resolving the conflicts with master now and will push the update shortly

@Divinesoumyadip
Copy link
Contributor Author

Conflicts resolved! I synced with master and ensured the changes from PR #9721 for ArraySpacingParser.cpp and KeepOutZoneParser.cpp are preserved. The remaining cut spacing parser files are ready for review

@Divinesoumyadip please look at the conflicts with master.

Conflicts resolved! I synced with master and ensured the changes from PR #9721 for ArraySpacingParser.cpp and KeepOutZoneParser.cpp are preserved. The remaining cut spacing parser files are ready for review.

@github-actions
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@eder-matheus eder-matheus enabled auto-merge March 12, 2026 14:15
@eder-matheus eder-matheus merged commit 5fbdc5d into The-OpenROAD-Project:master Mar 12, 2026
14 of 15 checks passed
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