Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ ExperimentalAutoDetectBinPacking: false
IndentCaseLabels: true
IndentWrappedFunctionNames: false
IndentFunctionDeclarationAfterType: false
InsertNewlineAtEOF: true
MaxEmptyLinesToKeep: 2
KeepEmptyLinesAtTheStartOfBlocks: false
KeepEmptyLines:
AtStartOfBlock: false
NamespaceIndentation: Inner
ObjCBlockIndentWidth: 4
ObjCBreakBeforeNestedBlockParam: false
Expand All @@ -53,6 +55,9 @@ PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Right
SpacesBeforeTrailingComments: 1
SpacesInLineCommentPrefix:
Minimum: 0
Maximum: -1
Cpp11BracedListStyle: true
Standard: Auto
IndentWidth: 4
Expand All @@ -73,6 +78,7 @@ BraceWrapping:
IndentBraces: false
SplitEmptyFunction: false

RemoveBracesLLVM: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpacesInAngles: false
Expand Down
30 changes: 13 additions & 17 deletions Testing Support/FormattedExample.m
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ @interface Foo
Update(UpdateType t, const Slice &v) : type(t), value(v.data(), v.size()) {}
};

/* Same deal here, don't mess with adding newlines after this comment block
* with a different comment style
Copy link
Member Author

Choose a reason for hiding this comment

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

these unfortunately produce a large amount of changes in our repo, but I can't seem to find which setting controls this behavior. I looked at all of the settings here marked with clang-format {XYZ} where XYZ was 13-19

/* Same deal here, don't mess with adding newlines after this comment block
* with a different comment style
* and trailing spaces */
@implementation Foo
@end
Expand Down Expand Up @@ -189,8 +189,7 @@ - (void)paranthesisInMessage
}

- (void)shortMethod
{
}
{}

- (void)dictsInArray
{
Expand All @@ -215,23 +214,20 @@ BOOL CStyleMethod()

INSAFSuccessBlock INSAPIClientModelSuccessHandler(Class mantleClass, NSString *__nullable keyPath, INSHTTPSuccess __nullable success, INSHTTPFailure __nullable failure)
{
return INSAPIClientModelSuccessChain(
mantleClass, keyPath, ^(__kindof INSModel *model, id _) {
if (success) {
success(model);
}
}, failure);
return INSAPIClientModelSuccessChain(mantleClass, keyPath, ^(__kindof INSModel *model, id _) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I believe this might be controlled by https://clang.llvm.org/docs/ClangFormatStyleOptions.html#lambdabodyindentation but its not clear if there's a way to not change these. However, the new version seems nicer IMO.

if (success) {
success(model);
}
}, failure);
}

- (void)fetchWithSuccess:(nullable dispatch_block_t)success failure:(nullable INSHTTPFailure)failure
{
[self GET:@"data" parameters:nil success:INSAPIClientModelArraySuccessChain(
[INSModel class], nil, ^(INSModel *model, id responseObject) {
if (success) {
success();
}
}, failure)
failure:failure];
[self GET:@"data" parameters:nil success:INSAPIClientModelArraySuccessChain([INSModel class], nil, ^(INSModel *model, id responseObject) {
if (success) {
success();
}
}, failure) failure:failure];
}

- (void)postWithSuccess:(nullable INSHTTPSuccess)success failure:(nullable INSHTTPFailure)failure
Expand Down
4 changes: 2 additions & 2 deletions bin/README
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
`clang-format-12.0.0` from:
https://github.com/llvm/llvm-project based upon 244022a3cd75b51dcf1d2a5a822419492ce79e47, built with DCMAKE_BUILD_TYPE=Release
`clang-format-19.1.4` from:
https://github.com/swift/llvm-project based upon https://github.com/swiftlang/llvm-project/releases/tag/swift-6.1.1-RELEASE, built with DCMAKE_BUILD_TYPE=Release
Binary file not shown.
17 changes: 0 additions & 17 deletions custom/NewLineAtEndOfFileInserter.py

This file was deleted.

5 changes: 2 additions & 3 deletions format-objc-file.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,10 @@ function format_objc_file_dry_run() {
/usr/bin/python3 "$DIR"/custom/InlineConstructorOnSingleLine.py |
/usr/bin/python3 "$DIR"/custom/MacroSemicolonAppender.py |
/usr/bin/python3 "$DIR"/custom/DoubleNewlineInserter.py |
"$DIR"/bin/clang-format-12.0.0-244022a3cd75b51dcf1d2a5a822419492ce79e47 -style=file |
"$DIR"/bin/clang-format-19.1.4-fd3b4acf03680a2dafbf1d40b562f5dff1c4436f -style=file |
/usr/bin/python3 "$DIR"/custom/GenericCategoryLinebreakIndentation.py |
/usr/bin/python3 "$DIR"/custom/ParameterAfterBlockNewline.py |
/usr/bin/python3 "$DIR"/custom/HasIncludeSpaceRemover.py |
/usr/bin/python3 "$DIR"/custom/NewLineAtEndOfFileInserter.py
Copy link
Member Author

Choose a reason for hiding this comment

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

this is obsolete now that clang-format includes an option to force a newline before EOF via InsertNewlineAtEOF: true

/usr/bin/python3 "$DIR"/custom/HasIncludeSpaceRemover.py
}

function format_objc_file() {
Expand Down
Loading