Skip to content

Commit

Permalink
Cleaned up most white space issues and many formatting inconsistencies.
Browse files Browse the repository at this point in the history
This supercedes #428. Please consider the remark added to CONTRIBUTING.md.
  • Loading branch information
erikdoe committed Jan 7, 2021
1 parent c81c481 commit 57139aa
Show file tree
Hide file tree
Showing 80 changed files with 2,280 additions and 2,270 deletions.
7 changes: 6 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ This project adheres to the [Contributor Covenant 1.2](http://contributor-covena

Please remember that OCMock has been around for 10+ years. Some of the coding conventions used in OCMock may contradict modern guidelines. However, in the interest of keeping the codebase consistent, please respect the conventions used. In particular:

* Opening and closing braces always go on a separate line.
* Use four spaces for indentation.
* Opening and closing braces always go on a separate line (except with blocks).
* No spaces between keywords like `if` and `for` and the following bracket.
* No underscores for instance variables.
* OCMock itself (framework and library) does not use ARC; retains and releases must be sent manually. The unit tests, however, do use ARC.

The repository contains a `.clang-format` file in the actual source directory. This should get you mostly there. Please apply the formatting defined in the config file only to code you add or modify. Please do not apply the formatting to entire files as there are still some inconsistencies in parts of the codebase and certain cases are not formatted correctly by clang-format.


38 changes: 38 additions & 0 deletions Source/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
BasedOnStyle: WebKit
#AlignConsecutiveDeclarations: true (only in instance var declarations)
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: Empty
BraceWrapping:
AfterCaseLabel: false
AfterControlStatement: Always
AfterEnum: false
AfterFunction: true
AfterObjCDeclaration: true
AfterStruct: false
AfterUnion: false
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Allman
IncludeCategories:
- Regex: '^<[a-z]*'
Priority: -4
- Regex: '^<NS*'
Priority: -3
- Regex: '^<XC*'
Priority: -2
- Regex: '^"NS*'
Priority: -1
- Regex: '.*'
Priority: 4
IndentCaseLabels: true
MaxEmptyLinesToKeep: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: false
PenaltyBreakAssignment: 50
PenaltyBreakBeforeFirstCallParameter: 50
PointerAlignment: Right
SpaceBeforeParens: Never
Loading

0 comments on commit 57139aa

Please sign in to comment.