Comments (6)
hello @hiroMTB!
since last year there is a .clang-format file in the repository. it follows pretty well the previous formatting, with a little bit more spaces around some markers.
about auto-formatting, there was sort of a "soft decision" made not to blanket the git history with a "clang-format" white-space commits, but to reformat when a file needs a change (the commits being squashed, it can be performed as a separate commit in for the PR review, but it will no show up in the final history/blame (and the whitespace exclusion in git works relatively well to not register as "changes")).
also sometimes macros and "nicely indented data tables" are better to exclude from clang-format, which means a manual review is always preferable after a reformat.
there are different ways to apply the formatting; the git clang-format
is one, and I use this automator approach on Xcode.
from openframeworks.
it would be great to format the entire core in one PR, but this has the potential to break a lot of PRs.
I think it is ok if it is right before the next release
from openframeworks.
Wow! Thank you for your detailed explanation. I will try clang-format and automator.
if we rely on manual review, probably we will keep seeing indent errors for future. But I can understand your point too.
Maybe we can arrange "format party" every month🤣
from openframeworks.
oh! I see, good point!
Btw, how do the other big C++ projects manage this issue? Maintainers do it manually?
from openframeworks.
well when I looked last year nothing clear was found, and I subscribed here NVIDIA/stdexec#905 thinking that when @ericniebler figures it out we can evaluate their choices...
from openframeworks.
clang-format is definitely the way.
However it does not explicitly support A Style.
We can override this by adding a .clang-format file in root directory with some custom settings to make it more A Style:
---
Language: Cpp
# Based on Google style as a starting point
BasedOnStyle: Google
# Indentation width
IndentWidth: 4
# Use spaces instead of tabs for indentation
UseTab: Never
# Brace wrapping
BraceWrapping:
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
# Column limit
ColumnLimit: 80
# Pointer and reference alignment
PointerAlignment: Left
# Includes sorting
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^".*'
Priority: 0
IncludeBlocks: Regroup
# Control the alignment of assignments
AlignConsecutiveAssignments: true
# Control the alignment of declarations
AlignConsecutiveDeclarations: true
from openframeworks.
Related Issues (20)
- shadow the C++20 std::numbers in of::numbers
- [actions] ideas HOT 1
- ofSignedNoise(float x) always returns zero
- [idea] VerticalSync outside of GLFW
- ofAVFoundationVideoPlayer thread priority
- [MSVC] OpenFrameworks failed to build error MSB3073: xcopy /Y /E "C:\gitP\openframeworks\openFrameworks\examples\templates\emptyExample\dll\x64\*.dll" HOT 7
- [MSVC] OpenFrameworks failed to build with "ofxAssimpAnimation.obj : error LNK2001: unresolved external symbol "public: struct aiNode" HOT 2
- ofGLFWWindowSettings::monitor has no effect (with Windows) HOT 6
- ofxSvg current svgtiny.lib does not work - Visual Studio HOT 8
- assimp3DModelLoaderExample text mirrored in Visual Studio HOT 3
- problem with iOS examples assimpExample & iPhoneGuiExample based on MyGuiView.storyboard
- macOS XCode build failed with unkown argument "-index-store-path" and cannot specify -o when generating multiple output files HOT 1
- ofCairoRenderer - ofTranslate not reset in a new frame
- math PI define issue HOT 3
- emscripten complied libpugixml issue HOT 1
- ofGLFWWindow - settings.monitor not right no macOS, depending on main window size
- CI problem with VS jobs related to freetype / brotli HOT 1
- OF_FBOMODE_NODEFAULTS doesn't set identity matrices
- [suggestion] folder organization - libs separated from openFrameworks & openFrameworksCompiled HOT 1
- Github Actions Cache HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openframeworks.