Skip to content

Single-file CI and code style adoption#2011

Draft
brendan-nasa wants to merge 31 commits intomasterfrom
clang-format-proposal
Draft

Single-file CI and code style adoption#2011
brendan-nasa wants to merge 31 commits intomasterfrom
clang-format-proposal

Conversation

@brendan-nasa
Copy link
Copy Markdown
Contributor

@brendan-nasa brendan-nasa commented Dec 14, 2025

  • An initial .clang-format1 (ci script to follow)
  • intent:
    • pick a style
    • stick to it for all new/modified code
    • trick approaches consistency with every merge :)
    • no more caring about how ugly/pretty your code is. run git clang-format before commit and be done with it
  • Choice of BasedOnStyle is ultimately arbitrary, but current trick codebase matches WebKit style2 closest3
  • Code styles can be explored at https://clang-format-configurator.site/
  • Only a bare minimum, first step to adopting more automated tooling (clang-tidy linter would be the next step)

Footnotes

  1. its not allman, but it is a nice middle ground :)

  2. See WebKit's style guidelines for what's included

  3. alandefreitas/clang-unformat was run on trick repo and webkit resulted in least number of lines changed

@coveralls
Copy link
Copy Markdown

coveralls commented Dec 14, 2025

Coverage Status

Coverage is 55.991%clang-format-proposal into master. No base build found for master.

@brendan-nasa brendan-nasa self-assigned this Jan 29, 2026
@brendan-nasa
Copy link
Copy Markdown
Contributor Author

brendan-nasa commented Jan 30, 2026

placing this here for future reference

# clangd for vscode/zed/nvim
CompileFlags:
   Add:
      - -I<trick path>/trick/include
      - -I<trick path>/trick/share/trick

@brendan-nasa
Copy link
Copy Markdown
Contributor Author

jeod already has a clang-format configuration1 (maybe just adopt theirs after going over it)

existing clang-format configs in the nasa org can be viewed here: https://github.com/search?q=user%3Anasa+path%3Aclang-format&type=code&ref=advsearch

Footnotes

  1. https://github.com/nasa/jeod/blob/main/.clang-format

@brendan-nasa
Copy link
Copy Markdown
Contributor Author

brendan-nasa commented Feb 26, 2026

an example of integrating clang-format from an existing industry C/C++ codebase:
https://gitlab.com/AOMediaCodec/avm/-/tree/research-v13.0.0?ref_type=tags#coding-style

@brendan-nasa brendan-nasa force-pushed the clang-format-proposal branch from 933021c to 373e6cc Compare April 9, 2026 20:57
@brendan-nasa brendan-nasa force-pushed the clang-format-proposal branch from 373e6cc to 193b719 Compare April 10, 2026 19:29
@brendan-nasa brendan-nasa changed the title Standardize code style using clang-format Single-file CI and clang-format adoption Apr 10, 2026
@brendan-nasa brendan-nasa changed the title Single-file CI and clang-format adoption Single-file CI and code style adoption Apr 10, 2026
@brendan-nasa brendan-nasa force-pushed the clang-format-proposal branch from db0f036 to 3d4487a Compare April 22, 2026 22:30
@brendan-nasa brendan-nasa force-pushed the clang-format-proposal branch from 3d4487a to 25af929 Compare April 22, 2026 22:31
@brendan-nasa brendan-nasa force-pushed the clang-format-proposal branch from a4d9958 to f17f5f3 Compare April 23, 2026 20:38
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