Skip to content

Comments

Update C++ style guide#914

Merged
geoffromer merged 1 commit intogoogle:gh-pagesfrom
zetafunction:gh-pages
Apr 10, 2025
Merged

Update C++ style guide#914
geoffromer merged 1 commit intogoogle:gh-pagesfrom
zetafunction:gh-pages

Conversation

@zetafunction
Copy link
Contributor

  • Expand guidance around usage of functions (and variables) with inline definitions.
  • Change guidance around internal namespaces to reduce the likelihood of collisions.
  • Expand naming guidance, with specific additional rules around:
    • nested namespaces not reusing well-known top-level names
    • template parameters
    • name aliases
  • Clarify that constant-style naming also applies to static class constants.
  • Other miscellaneous formatting and documentation improvements, e.g. additional Abseil TotW links.

These style guides are copies of Google's internal style guides to
assist developers working on Google owned and originated open source
projects. Changes should be made to the internal style guide first and
only then copied here.

Unsolicited pull requests will not be merged and are usually closed
without comment. If a PR points out a simple mistake — a typo, a broken
link, etc. — then the correction can be made internally and copied here
through the usual process.

Substantive changes to the style rules and suggested new rules should
not be submitted as a PR in this repository. Material changes must be
proposed, discussed, and approved on the internal forums first.

@zetafunction
Copy link
Contributor Author

@geoffromer please take a look when you can; thanks!

@geoffromer
Copy link
Collaborator

The problems I flagged should now be fixed upstream.

- Expand guidance around usage of functions (and variables) with inline
  definitions.
- Change guidance around internal namespaces to reduce the likelihood of
  collisions.
- Expand naming guidance, with specific additional rules around:
  - nested namespaces not reusing well-known top-level names
  - template parameters
  - name aliases
- Clarify that constant-style naming also applies to static class
  constants.
- Other miscellaneous formatting and documentation improvements, e.g.
  additional Abseil TotW links.
@zetafunction
Copy link
Contributor Author

Thanks, I believe all comments should be addressed now. I think I messed up the conversations though since I used a force push—sorry not really used to the GH contribution workflow.

@geoffromer geoffromer merged commit 445123e into google:gh-pages Apr 10, 2025
1 check passed
tools. If the project you are contributing to does not,
you can download
<a href="https://raw.githubusercontent.com/cpplint/cpplint/HEAD/cpplint.py">
<a href="https://raw.githubusercontent.com/google/styleguide/gh-pages/cpplint/cpplint.py">
Copy link

@aaronliu0130 aaronliu0130 Apr 17, 2025

Choose a reason for hiding this comment

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

@zetafunction Was there a reason for this change? Since this PR was deployed, this has been linking to the bankrupted version... I'm guessing the bankruptcy PR was just never ported to the internal version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This update is generated from the internal style guide. If someone makes a PR to update the external style guide but that change never makes it to the internal style guide, it's going to be overwritten by the next update.

Copy link
Member

Choose a reason for hiding this comment

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

i.e. I screwed up. someone has posted a fix internally for it though, so it should make its way back out.

@vapier vapier added the lang:cpp The C++ language label Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang:cpp The C++ language

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants