Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@GavinRay97
Last active May 5, 2021 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GavinRay97/882436a2668085e2b188db3f9e836f81 to your computer and use it in GitHub Desktop.
Save GavinRay97/882436a2668085e2b188db3f9e836f81 to your computer and use it in GitHub Desktop.
JUCE clang-format using whatstyle

Intro

I chose to run whatstyle.py on juce_VST3_Wrapper.cpp because of the headers and cpp files in the project, it was one of the largest. Note that the BinaryData files actually contain binary data, and that WindowedSincInterpolator.cpp contains massive data arrays that take up space.

In an ideal scenario, I would run this on an amalgamted JUCE build of all the files in the project using: https://github.com/rindeal/Amalgamate

(I have this already and may run this again on that file)

Test was run via: python3 whatstyle.py -f clang-format $HOME/Projects/JUCE/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp

JUCE on  develop [?] via 喝 v3.16.3
❯ find . -printf '%s %p\n'| sort -nr | head -100 | grep .cpp
671234 ./extras/Projucer/JuceLibraryCode/BinaryData.cpp 
370393 ./extras/Projucer/Source/Utility/UI/jucer_Icons.cpp
325993 ./modules/juce_audio_basics/utilities/juce_WindowedSincInterpolator.cpp
178097 ./modules/juce_gui_basics/native/juce_win32_Windowing.cpp
170578 ./extras/AudioPluginHost/JuceLibraryCode/BinaryData.cpp
164175 ./extras/NetworkGraphicsDemo/JuceLibraryCode/BinaryData.cpp
145492 ./modules/juce_gui_basics/native/x11/juce_linux_XWindowSystem.cpp
141201 ./modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
133714 ./modules/juce_audio_formats/codecs/juce_MP3AudioFormat.cpp
131379 ./modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp
128709 ./modules/juce_gui_basics/lookandfeel/juce_LookAndFeel_V2.cpp
128151 ./modules/juce_audio_processors/format_types/juce_VST3PluginFormat.cpp
108287 ./modules/juce_core/text/juce_String.cpp
104816 ./modules/juce_audio_basics/mpe/juce_MPEInstrument.cpp
102711 ./modules/juce_audio_plugin_client/AAX/juce_AAX_Wrapper.cpp
101875 ./modules/juce_gui_basics/components/juce_Component.cpp
101736 ./extras/Projucer/Source/Project/jucer_Project.cpp
94060 ./modules/juce_audio_processors/format_types/VST3_SDK/base/source/fstring.cpp

Results

Round 24  #formatted 10/10
The formatter was run 1213 times of which 0 runs were unusable.
### This style was chosen for your .clang-format
BasedOnStyle: WebKit
AlignAfterOpenBracket: Align
AlignOperands: true
AllowShortCaseLabelsOnASingleLine: true
AllowShortIfStatementsOnASingleLine: true
BraceWrapping:
  AfterClass: true
  AfterControlStatement: true
  AfterFunction: true
  AfterNamespace: true
  AfterStruct: true
  BeforeElse: true
  SplitEmptyRecord: false
BreakBeforeBraces: Custom
BreakConstructorInitializers: BeforeColon
IndentCaseLabels: true
MaxEmptyLinesToKeep: 2
ReflowComments: false
SortIncludes: false
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: true
SpaceBeforeParens: Always
SpaceInEmptyBlock: false

Log

whatstyle on  master via 🐍 v3.10.0a7
❯ python3 whatstyle.py -f clang-format $HOME/Projects/JUCE/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp
Warning: We don't know about the option 'AlignConsecutiveMacros' that your clang-format supports.
Warning: We don't know about the option 'AlignConsecutiveBitFields' that your clang-format supports.
Warning: We don't know about the option 'AllowAllArgumentsOnNextLine' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'AllowAllConstructorInitializersOnNextLine' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'AllowShortEnumsOnASingleLine' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'AllowShortLambdasOnASingleLine' that your clang-format supports.
Warning: We don't know about the option 'AttributeMacros' that your clang-format supports.
Warning: We don't know about the option 'BreakBeforeConceptDeclarations' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'BreakInheritanceList' that your clang-format supports.
Warning: We don't know about the option 'BreakConstructorInitializersBeforeComma' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'DeriveLineEnding' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'EmptyLineAfterAccessModifier' that your clang-format supports.
Warning: We don't know about the option 'EmptyLineBeforeAccessModifier' that your clang-format supports.
Warning: We don't know about the option 'StatementAttributeLikeMacros' that your clang-format supports.
Warning: We don't know about the option 'IncludeIsMainSourceRegex' that your clang-format supports.
Warning: We don't know about the option 'IndentAccessModifiers' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'IndentCaseBlocks' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'IndentGotoLabels' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'IndentExternBlock' that your clang-format supports.
Warning: We don't know about the option 'IndentRequires' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'InsertTrailingCommas' that your clang-format supports.
Warning: We don't know about the option 'ObjCBreakBeforeNestedBlockParam' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'PenaltyBreakTemplateDeclaration' that your clang-format supports.
Warning: We don't know about the option 'PenaltyIndentedWhitespace' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'ShortNamespaceLines' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'SortJavaStaticImport' that your clang-format supports.
Warning: We don't know about the option 'SpaceAfterLogicalNot' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'SpaceBeforeCaseColon' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'SpaceBeforeCpp11BracedList' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'SpaceAroundPointerQualifiers' that your clang-format supports.
Warning: We don't know about the option 'SpaceInEmptyBlock' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'SpacesInConditionalStatement' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'SpacesInLineCommentPrefix' that your clang-format supports.
Warning: We don't know about the option 'SpaceBeforeSquareBrackets' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
Warning: We don't know about the option 'BitFieldColonSpacing' that your clang-format supports.
Warning: We don't know about the option 'StatementMacros' that your clang-format supports.
Warning: We don't know about the option 'UseCRLF' that your clang-format supports.
... but it looks like a bool type and we might as well tweak it.
-----------------------
Running whatstyle 0.1.9
Using formatter /home/user/Projects/llvm/llvm-prebuilt/llvm13-ninja-gcc-x64-rel/bin/clang-format (clang-format version 13.0.0 (https://github.com/llvm/llvm-project.git 81cad0be687e3db027b6035e2193a805eb1b6ced))
Using this for comparing files: /usr/bin/python3 -u /home/user/whatstyle/whatstyle.py --stdindiff -- #FILENAME#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment