├── .eslintrc.js
├── ApexDocsConfig.json
├── IlluminatedCloud_Apex_CodeFormatting_Style.xml
├── MockDataBuilder
├── MockIdBuilder.cls
├── MockSObjectBuilder.cls
└── MockSObjectBuilder_Test.cls
├── README.md
├── Util_DML_Operations.cls
├── Util_Error_Logger.cls
├── Util_Process_Builder_Terminator.cls
├── Util_Process_Builder_Trigger_Bypass.cls
├── Util_Process_Builder_Trigger_Restart.cls
├── apexRules.xml
└── uncrustify.cfg
/.eslintrc.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | "parser": "babel-eslint",
3 | "plugins": ["@lwc/eslint-plugin-lwc"],
4 | "env": {
5 | "browser": true,
6 | "es2020": true
7 | },
8 | "extends": "eslint:recommended",
9 | "parserOptions": {
10 | "ecmaVersion": 11,
11 | "sourceType": "module"
12 | },
13 | "rules": {
14 | "@lwc/lwc/no-deprecated": "error",
15 | "@lwc/lwc/valid-api": "error",
16 | "@lwc/lwc/no-document-query": "error",
17 | "indent": [
18 | "error",
19 | "tab"
20 | ],
21 | "linebreak-style": [
22 | "error",
23 | "unix"
24 | ],
25 | "quotes": [
26 | "error",
27 | "double"
28 | ],
29 | "semi": [
30 | "error",
31 | "always"
32 | ],
33 | "brace-style": [
34 | "error", "allman", { "allowSingleLine": false }
35 | ],
36 | "curly": [
37 | "error", "all"
38 | ]
39 | }
40 | };
41 |
--------------------------------------------------------------------------------
/ApexDocsConfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "root": "[Location where you want your apex doc markdowns to live]",
3 | "sourceLanguage": "java",
4 | "content": {
5 | "startingHeadingLevel": 1,
6 | "includeAuthor": true,
7 | "includeDate": true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/IlluminatedCloud_Apex_CodeFormatting_Style.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/MockDataBuilder/MockIdBuilder.cls:
--------------------------------------------------------------------------------
1 | @isTest
2 | public with sharing class MockIdBuilder {
3 |
4 | public static Integer idCount = 0;
5 |
6 | //Get a fake id for a given SObjectType
7 | public static String getMockId(SObjectType objectType) {
8 |
9 | String nextIdCount = String.valueOf(idCount++);
10 |
11 | return objectType.getDescribe().getKeyPrefix()
12 | + getFillerZeros(nextIdCount)
13 | + nextIdCount;
14 | }
15 |
16 | //Gets how many 0's the id needs for correct length
17 | private static String getFillerZeros(String nextIdCount) {
18 | return '0'.repeat(12-nextIdCount.length());
19 | }
20 | }
--------------------------------------------------------------------------------
/MockDataBuilder/MockSObjectBuilder.cls:
--------------------------------------------------------------------------------
1 | public with sharing class MockSObjectBuilder {
2 |
3 | public SObjectType mockType {get; private set;}
4 |
5 | private String starterSObject;
6 |
7 | private static Integer idCount = 1;
8 |
9 | private Map fieldToValue = new Map();
10 | private Map> relationshipToChild = new Map>();
11 | private Map parentsByLabels = new Map();
12 |
13 | //Initialize a builder with an sobject type
14 | public MockSObjectBuilder(SObjectType type) {
15 | mockType = type;
16 | }
17 |
18 | //Initialize a builder with an existing sobject
19 | public MockSObjectBuilder(SObject starterObject) {
20 | mockType = starterObject.getSObjectType();
21 | starterSObject = JSON.serialize(starterObject);
22 | }
23 |
24 | //Set a normal field on the sobject using the schema field name
25 | public MockSObjectBuilder setField(SObjectField field, String value) {
26 | fieldToValue.put(field, value);
27 | return this;
28 | }
29 |
30 | //Set a normal field on the sobject using the string field name
31 | public MockSObjectBuilder setField(String field, String value) {
32 | SObjectField describeField = getDescribeFieldFromString(field);
33 | setField(describeField, value);
34 | return this;
35 | }
36 |
37 | //Set a date field on the sobject using the string field name
38 | public MockSObjectBuilder setField(String field, Date value) {
39 | SObjectField describeField = getDescribeFieldFromString(field);
40 | String stringifiedValue = trimQuotes(JSON.serialize(value));
41 | setField(describeField, stringifiedValue);
42 | return this;
43 | }
44 |
45 | //Set a datetime field on the sobject using the string field name
46 | public MockSObjectBuilder setField(String field, Datetime value) {
47 | SObjectField describeField = getDescribeFieldFromString(field);
48 | String stringifiedValue = trimQuotes(JSON.serialize(value));
49 | setField(describeField, stringifiedValue);
50 | return this;
51 | }
52 |
53 | //Trim the last quote from json values when building strings
54 | private String trimQuotes(String longValue) {
55 | return longValue.substring(1, longValue.length() - 1);
56 | }
57 |
58 | //Parse the json string for a fields value using schema field name
59 | public String getField(SObjectField field) {
60 |
61 | String value = '';
62 |
63 | if (fieldToValue.containsKey(field)) {
64 | value = fieldToValue.get(field);
65 | }
66 | return value;
67 | }
68 |
69 | //Parse the json string for a fields value using string field name
70 | public String getField(String field) {
71 | SObjectField describeField = getDescribeFieldFromString(field);
72 | return getField(describeField);
73 | }
74 |
75 | //Get the schema value from a string field name
76 | private SObjectField getDescribeFieldFromString(String field) {
77 | return mockType.getDescribe().fields.getMap().get(field);
78 | }
79 |
80 | //Convenience function to set a new id on an sobject being built
81 | public MockSObjectBuilder setId() {
82 | setField('Id', getMockId());
83 | return this;
84 | }
85 |
86 | //Get a mock id of the instantiated type
87 | public String getMockId() {
88 | return getMockId(mockType);
89 | }
90 |
91 | //Utility method to get an id of a given type
92 | public static String getMockId(SObjectType objectType) {
93 |
94 | String nextIdCount = String.valueOf(idCount++);
95 |
96 | return objectType.getDescribe().getKeyPrefix()
97 | + getFillerZeros(nextIdCount)
98 | + nextIdCount;
99 | }
100 |
101 | //Determine how many 0s are needed to pad the id for the correct length of id
102 | private static String getFillerZeros(String nextIdCount) {
103 | return '0'.repeat(12-nextIdCount.length());
104 | }
105 |
106 | //Gets a schema child relationship given its string name
107 | public ChildRelationship getChildRelationship(String childLabel) {
108 |
109 | ChildRelationship relationship;
110 |
111 | for (ChildRelationship childRel : mockType.getDescribe().getChildRelationships()) {
112 | if (childRel.getRelationshipName() == childLabel) {
113 | relationship = childRel;
114 | }
115 | }
116 |
117 | return relationship;
118 | }
119 |
120 | //Sets a parent object and id for the current build object
121 | public MockSObjectBuilder setParent(String parentLabel, SObject parent) {
122 |
123 | if (parent != null) {
124 |
125 | String idKey = getIdFieldNameFromRelationshipName(parentLabel);
126 | if (getDescribeFieldFromString(idKey) != null) {
127 | parentsByLabels.put(parentLabel, JSON.serialize(parent));
128 | setParentId(parentLabel, parent);
129 | }
130 | }
131 |
132 | return this;
133 | }
134 |
135 | //Sets up the parent id from a parent object label
136 | private void setParentId(String parentLabel, SObject parent) {
137 | if (parent != null && parent.Id != null) {
138 | String idKey = getIdFieldNameFromRelationshipName(parentLabel);
139 | setField(idKey, parent.Id);
140 | }
141 | }
142 |
143 | //Determines methodology for naming parent id field: '__c' for custom, 'Id' for standard
144 | private String getIdFieldNameFromRelationshipName(String parentLabel) {
145 |
146 | String idKey = '';
147 | if (parentLabel.contains('__r')) {
148 | idKey = parentLabel.substring(0, parentLabel.length() - 1) + 'c';
149 | } else {
150 | idKey = parentLabel + 'Id';
151 | }
152 | return idKey;
153 | }
154 |
155 | //Sets a child object for a string child relationship name
156 | public MockSObjectBuilder setChild(String childLabel, SObject child) {
157 | return setChild(getChildRelationship(childLabel), JSON.serialize(child));
158 | }
159 |
160 | //Sets multiple children for a string child relationship name
161 | public MockSObjectBuilder setChildren(String childLabel, List children) {
162 | List serializedChildren = new List();
163 | for (SObject child : children) {
164 | serializedChildren.add(JSON.serialize(child));
165 | }
166 | return setChildren(getChildRelationship(childLabel), serializedChildren);
167 | }
168 |
169 | //Sets a serialized (string-form) child from a child relationship string name
170 | public MockSObjectBuilder setChild(String childLabel, String serializedChild) {
171 | return setChild(getChildRelationship(childLabel), serializedChild);
172 | }
173 |
174 | //Sets multiple serialized (string-form) children from a child relationship string name
175 | public MockSObjectBuilder setChildren(String childLabel, List serializedChildren) {
176 | return setChildren(getChildRelationship(childLabel), serializedChildren);
177 | }
178 |
179 | //Sets multiple children for a schema child relationship name
180 | public MockSObjectBuilder setChild(ChildRelationship childRel, String serializedChild) {
181 | setChildren(childRel, new List{serializedChild});
182 | return this;
183 | }
184 |
185 | //Sets multiple children for a schema child relationship name
186 | public MockSObjectBuilder setChildren(ChildRelationship childRel, List serializedChildren) {
187 | if (!relationshipToChild.containsKey(childRel)) {
188 | relationshipToChild.put(childRel, new List());
189 | }
190 | for (String child : serializedChildren) {
191 | relationshipToChild.get(childRel).add(child);
192 | }
193 | return this;
194 | }
195 |
196 | //Builds the currently building sobject
197 | public SObject build() {
198 |
199 | String jsonSObject = getSerializedSObject();
200 | SObject mockObject = (SObject) JSON.deserialize(jsonSObject, SObject.class);
201 |
202 | return mockObject;
203 | }
204 |
205 | //Returns the string-form of the currently uilding object
206 | public String getSerializedSObject() {
207 |
208 | String jsonSObject = '';
209 |
210 | if (starterSObject == null) {
211 | jsonSObject = JSON.serialize(mockType.newSObject());
212 | } else {
213 | jsonSObject = starterSObject;
214 | }
215 |
216 | jsonSObject = openJson(jsonSObject)
217 | + appendJsonFields()
218 | + appendParents()
219 | + appendChildRelationships()
220 | + closeJson();
221 |
222 | return jsonSObject;
223 | }
224 |
225 | //JSON parsing function
226 | //Opens the json object
227 | private String openJson(String jsonSObject) {
228 | return jsonSObject.substring(0, jsonSObject.length() - 1);
229 | }
230 |
231 | //JSON parsing function
232 | //Appends a field to the JSON object
233 | private String appendJsonFields() {
234 | String fieldsToAppend = '';
235 | for (SObjectField field : fieldToValue.keySet()) {
236 | fieldsToAppend += ',"' + field + '":"' + fieldToValue.get(field) + '"';
237 | }
238 | return fieldsToAppend;
239 | }
240 |
241 | //JSON parsing function
242 | //Appends a parent object to the JSON object
243 | private String appendParents() {
244 | String parentsToAppend = '';
245 | for (String parentLabel : parentsByLabels.keySet()) {
246 | parentsToAppend += ',"';
247 | parentsToAppend += parentLabel;
248 | parentsToAppend += '":';
249 | parentsToAppend += parentsByLabels.get(parentLabel);
250 | }
251 | return parentsToAppend;
252 | }
253 |
254 | //JSON parsing function
255 | //Appends children objects to the JSON object
256 | private String appendChildRelationships() {
257 | String childrenToAppend = '';
258 | for (ChildRelationship relationship : relationshipToChild.keySet()) {
259 | List serializedChildren = relationshipToChild.get(relationship);
260 | childrenToAppend += getRelationshipName(relationship)
261 | + getRelationshipHeaderInfo(serializedChildren.size())
262 | + getRecordStart()
263 | + getChildRecords(serializedChildren)
264 | + closeChildList();
265 | }
266 | return childrenToAppend;
267 | }
268 |
269 | //JSON parsing function
270 | //Appends a parent object to the JSON object
271 | private String getRelationshipName(ChildRelationship relationship) {
272 | return ',"' + relationship.getRelationshipName() + '":{';
273 | }
274 |
275 | //JSON parsing function
276 | //Appends a child relationship header
277 | private String getRelationshipHeaderInfo(Integer childCount) {
278 | return'"totalSize":' + childCount + ',"done":true,';
279 | }
280 |
281 | //JSON parsing function
282 | //Appends the beginning of the child list
283 | private String getRecordStart() {
284 | return '"records":[';
285 | }
286 |
287 | //JSON parsing function
288 | //AAppends the list of child records
289 | private String getChildRecords(List serializedChildren) {
290 | String childRecords = '';
291 | for (String child : serializedChildren) {
292 | childRecords += child + ',';
293 | }
294 | childRecords = childRecords.substring(0, childRecords.length() - 1);
295 | return childRecords;
296 | }
297 |
298 | //JSON parsing function
299 | //Appends the JSON child list closing
300 | private String closeChildList() {
301 | return ']}';
302 | }
303 |
304 | //JSON parsing function
305 | //Appends the JSON object closing
306 | private String closeJson() {
307 | return '}';
308 | }
309 | }
--------------------------------------------------------------------------------
/MockDataBuilder/MockSObjectBuilder_Test.cls:
--------------------------------------------------------------------------------
1 | @isTest
2 | private class MockSObjectBuilder_Test {
3 |
4 | private static String TEST_NAME = 'Raymond Powell';
5 | private static String TEST_NAME_2 = 'Henery Kennsington';
6 | private static String TEST_PHONE = '1234567890';
7 | private static String CHILD_LABEL_OPPORTUNITIES = 'Opportunities';
8 | private static String FIELD_LABEL_NAME = 'Name';
9 | private static String FIELD_LABEL_OWNER = 'Owner';
10 |
11 | @isTest
12 | static void build_hasStarterSObject_shouldMaintainPreviousFields() {
13 | Account acc = new Account(Owner = new User(), Phone = TEST_PHONE);
14 | MockSObjectBuilder mockAccountBuilder = new MockSObjectBuilder(acc);
15 |
16 | mockAccountBuilder.setField('Name', TEST_NAME);
17 |
18 | Test.startTest();
19 | Account mockAccount = (Account) mockAccountBuilder.build();
20 | Test.stopTest();
21 |
22 | System.assertEquals(TEST_NAME, mockAccount.Name, 'Account should have correct mock set name.');
23 | System.assertEquals(TEST_PHONE, mockAccount.Phone, 'Account should have correct previously set phone number.');
24 | System.assertEquals(new User(), mockAccount.Owner, 'Account should have previously set Owner.');
25 | }
26 |
27 | @isTest
28 | static void build_hasSObjectType_shouldBuildEmptySObject() {
29 |
30 | MockSObjectBuilder mockAccountBuilder = getTestMockAccountBuilder();
31 |
32 | Test.startTest();
33 | Account mockAccount = (Account) mockAccountBuilder.build();
34 | Test.stopTest();
35 |
36 | System.assertEquals(new Account(), mockAccount, 'Does not have default implementation of class');
37 | }
38 |
39 | @isTest
40 | static void build_hasFieldSet_objectShouldHaveFieldSet() {
41 |
42 | MockSObjectBuilder mockAccountBuilder = getTestMockAccountBuilder();
43 |
44 | SObjectField nameField = Account.Name.getDescribe().getSObjectField();
45 | mockAccountBuilder.setField(nameField, TEST_NAME);
46 |
47 | Test.startTest();
48 | Account mockAccount = (Account) mockAccountBuilder.build();
49 | Test.stopTest();
50 |
51 | System.assertEquals(TEST_NAME, mockAccount.Name, 'Object should have correct name.');
52 | }
53 |
54 | @isTest
55 | static void build_hasReadOnlyFieldSet_objectShouldHaveFieldSet() {
56 |
57 | MockSObjectBuilder mockUserBuilder = getTestMockUserBuilder();
58 |
59 | SObjectField readOnlyField = User.Name.getDescribe().getSObjectField();
60 | mockUserBuilder.setField(readOnlyField, TEST_NAME);
61 |
62 | Test.startTest();
63 | User mockUser = (User) mockUserBuilder.build();
64 | Test.stopTest();
65 |
66 | System.assertEquals(TEST_NAME, mockUser.Name, 'Object should have correct Name.');
67 | }
68 |
69 | @isTest
70 | static void build_hasDateAndDatetimeFieldSet_objectShouldHaveFieldSet() {
71 |
72 | MockSObjectBuilder mockOpportunityBuilder = getTestMockOpportunityBuilder();
73 |
74 | Datetime createdDate = Datetime.now();
75 | Date closeDate = Date.today();
76 |
77 | mockOpportunityBuilder.setField('CreatedDate', createdDate);
78 | mockOpportunityBuilder.setField('CloseDate', closeDate);
79 |
80 | Test.startTest();
81 | Opportunity mockOpportunity = (Opportunity) mockOpportunityBuilder.build();
82 | Test.stopTest();
83 |
84 | System.assertEquals(createdDate, mockOpportunity.CreatedDate, 'Object should have correct Close Date.');
85 | System.assertEquals(closeDate, mockOpportunity.CloseDate, 'Object should have correct Created Date.');
86 | }
87 |
88 | @isTest
89 | static void build_hasMultipleFieldsSet_objectShouldHaveAllFieldsSet() {
90 |
91 | MockSObjectBuilder mockUserBuilder = getTestMockUserBuilder()
92 | .setField(FIELD_LABEL_NAME, TEST_NAME)
93 | .setId();
94 |
95 | Test.startTest();
96 | User mockUser = (User) mockUserBuilder.build();
97 | Test.stopTest();
98 |
99 | System.assertEquals(TEST_NAME, mockUser.Name, 'Object should have correct Name.');
100 | System.assertEquals(mockUserBuilder.getField('Id'), mockUser.Id, 'Object should have correct Id.');
101 | }
102 |
103 | @isTest
104 | static void build_givenUnserializedChild_objectShouldHaveChild() {
105 |
106 | MockSObjectBuilder mockAccountBuilder = getTestMockAccountBuilder();
107 |
108 | mockAccountBuilder.setChild(CHILD_LABEL_OPPORTUNITIES, getTestMockOpportunityBuilder().setField(FIELD_LABEL_NAME, TEST_NAME).build());
109 |
110 | Test.startTest();
111 | Account mockAccount = (Account) mockAccountBuilder.build();
112 | Test.stopTest();
113 |
114 | System.assertEquals(TEST_NAME, mockAccount.Opportunities[0].Name, 'Object should have child');
115 | }
116 |
117 | @isTest
118 | static void build_givenChild_objectShouldHaveChild() {
119 |
120 | MockSObjectBuilder mockAccountBuilder = getTestMockAccountBuilder();
121 |
122 | mockAccountBuilder.setChild(CHILD_LABEL_OPPORTUNITIES, getSerializedOpp(TEST_NAME));
123 |
124 | Test.startTest();
125 | Account mockAccount = (Account) mockAccountBuilder.build();
126 | Test.stopTest();
127 |
128 | System.assertEquals(TEST_NAME, mockAccount.Opportunities[0].Name, 'Object should have child');
129 | }
130 |
131 | @isTest
132 | static void build_given2UnserializedChildren_objectShouldHave2Children() {
133 |
134 | MockSObjectBuilder mockAccountBuilder = getTestMockAccountBuilder();
135 | Opportunity opp = (Opportunity) getTestMockOpportunityBuilder()
136 | .setField(FIELD_LABEL_NAME, TEST_NAME)
137 | .build();
138 | Opportunity opp2 = (Opportunity) getTestMockOpportunityBuilder()
139 | .setField(FIELD_LABEL_NAME, TEST_NAME_2)
140 | .build();
141 |
142 | List serializedChildren = new List{opp, opp2};
143 |
144 | mockAccountBuilder.setChildren(CHILD_LABEL_OPPORTUNITIES, serializedChildren);
145 |
146 | Test.startTest();
147 | Account mockAccount = (Account) mockAccountBuilder.build();
148 | Test.stopTest();
149 |
150 | System.assertEquals(TEST_NAME, mockAccount.Opportunities[0].Name, 'Object should have first child');
151 | System.assertEquals(TEST_NAME_2, mockAccount.Opportunities[1].Name, 'Object should have second child');
152 | }
153 |
154 | @isTest
155 | static void build_given2Children_objectShouldHave2Children() {
156 |
157 | MockSObjectBuilder mockAccountBuilder = getTestMockAccountBuilder();
158 |
159 | List serializedChildren = new List{getSerializedOpp(TEST_NAME), getSerializedOpp(TEST_NAME_2)};
160 |
161 | mockAccountBuilder.setChildren(CHILD_LABEL_OPPORTUNITIES, serializedChildren);
162 |
163 | Test.startTest();
164 | Account mockAccount = (Account) mockAccountBuilder.build();
165 | Test.stopTest();
166 |
167 | System.assertEquals(TEST_NAME, mockAccount.Opportunities[0].Name, 'Object should have first child');
168 | System.assertEquals(TEST_NAME_2, mockAccount.Opportunities[1].Name, 'Object should have second child');
169 | }
170 |
171 | @isTest
172 | static void setParent_givenParentIsNull_shouldNotSetParent() {
173 |
174 | MockSObjectBuilder mockAccountBuilder = getTestMockAccountBuilder();
175 | String ownerField = FIELD_LABEL_OWNER;
176 |
177 | Test.startTest();
178 | Account mockAccount = (Account) mockAccountBuilder.setParent(ownerField, null).build();
179 | Test.stopTest();
180 |
181 | System.assertEquals(null, mockAccount.Owner, 'Object should not have parent owner');
182 | System.assertEquals(null, mockAccount.OwnerId, 'Object should not have parent ownerId');
183 | }
184 |
185 | @isTest
186 | static void setParent_givenInvalidParent_shouldNotSetParent() {
187 |
188 | MockSObjectBuilder mockAccountBuilder = getTestMockAccountBuilder();
189 | String invalidField = 'Invalid Field';
190 | User testUser = new User(Id = MockSObjectBuilder.getMockId(User.getSObjectType()), LastName = TEST_NAME);
191 |
192 | Test.startTest();
193 | Account mockAccount = (Account) mockAccountBuilder.setParent(invalidField, testUser).build();
194 | Test.stopTest();
195 | }
196 |
197 | @isTest
198 | static void build_givenParentField_shouldHaveParent() {
199 |
200 | MockSObjectBuilder mockAccountBuilder = getTestMockAccountBuilder();
201 | String ownerField = FIELD_LABEL_OWNER;
202 | User testUser = new User(Id = MockSObjectBuilder.getMockId(User.getSObjectType()), LastName = TEST_NAME);
203 |
204 | Test.startTest();
205 | Account mockAccount = (Account) mockAccountBuilder.setParent(ownerField, testUser).build();
206 | Test.stopTest();
207 |
208 | System.assertEquals(testUser.LastName, mockAccount.Owner.LastName, 'Object should have parent owner');
209 | System.assertEquals(testUser.Id, mockAccount.OwnerId, 'Object should have owner Id');
210 | }
211 |
212 | @isTest
213 | static void getSerializedSObject_givenEmptyObject_shouldReturnEmptyObject() {
214 |
215 | MockSObjectBuilder mockAccountBuilder = getTestMockAccountBuilder();
216 |
217 | Test.startTest();
218 | String accountJson = mockAccountBuilder.getSerializedSObject();
219 | Test.stopTest();
220 |
221 | System.assertEquals(JSON.serialize(new Account()), accountJson);
222 | }
223 |
224 | @isTest
225 | static void setField_givenField_shouldHaveField() {
226 |
227 | MockSObjectBuilder mockAccountBuilder = getTestMockAccountBuilder();
228 | SObjectField nameField = Account.Name.getDescribe().getSObjectField();
229 |
230 | Test.startTest();
231 | mockAccountBuilder.setField(nameField, TEST_NAME);
232 | Test.stopTest();
233 |
234 | System.assertEquals(TEST_NAME, mockAccountBuilder.getField(nameField), 'Field not found in builder.');
235 | }
236 |
237 | @isTest
238 | static void setField_givenFieldString_shouldHaveField() {
239 |
240 | MockSObjectBuilder mockAccountBuilder = getTestMockAccountBuilder();
241 | String nameField = FIELD_LABEL_NAME;
242 |
243 | Test.startTest();
244 | mockAccountBuilder.setField(nameField, TEST_NAME);
245 | Test.stopTest();
246 |
247 | System.assertEquals(TEST_NAME, mockAccountBuilder.getField(nameField), 'Field not found in builder.');
248 | }
249 |
250 | @isTest
251 | static void getMockId_givenNoPreviousIds_shouldReturnFirstId() {
252 |
253 | MockSObjectBuilder mockAccountBuilder = getTestMockAccountBuilder();
254 |
255 | Test.startTest();
256 | Id mockId = mockAccountBuilder.getMockId();
257 | Test.stopTest();
258 |
259 | System.assertEquals(mockAccountBuilder.mockType.getDescribe().getKeyPrefix() + '000000000001', mockId);
260 | }
261 |
262 | @isTest
263 | static void getMockId_givenOnePreviousId_shouldReturnSecondId() {
264 |
265 | MockSObjectBuilder mockAccountBuilder = getTestMockAccountBuilder();
266 | mockAccountBuilder.getMockId();
267 |
268 | Test.startTest();
269 | Id mockId = mockAccountBuilder.getMockId();
270 | Test.stopTest();
271 |
272 | System.assertEquals(mockAccountBuilder.mockType.getDescribe().getKeyPrefix() + '000000000002', mockId);
273 | }
274 |
275 | @isTest
276 | static void getChildRelationship_givenChildRelationshipLabel_shouldReturnChildRelationship() {
277 |
278 | MockSObjectBuilder mockAccountBuilder = getTestMockAccountBuilder();
279 |
280 | Test.startTest();
281 | ChildRelationship relationship = mockAccountBuilder.getChildRelationship(CHILD_LABEL_OPPORTUNITIES);
282 | Test.stopTest();
283 |
284 | System.assertEquals(CHILD_LABEL_OPPORTUNITIES, relationship.getRelationshipName());
285 | }
286 |
287 | private static MockSObjectBuilder getTestMockAccountBuilder() {
288 | return new MockSObjectBuilder(Account.getSObjectType());
289 | }
290 |
291 | private static MockSObjectBuilder getTestMockUserBuilder() {
292 | return new MockSObjectBuilder(User.getSObjectType());
293 | }
294 |
295 | private static MockSObjectBuilder getTestMockOpportunityBuilder() {
296 | return new MockSObjectBuilder(Opportunity.getSObjectType());
297 | }
298 |
299 | private static String getSerializedOpp(String name) {
300 | MockSObjectBuilder mockOpportunityBuilder = getTestMockOpportunityBuilder();
301 | mockOpportunityBuilder.setField(FIELD_LABEL_NAME, name);
302 | return mockOpportunityBuilder.getSerializedSObject();
303 | }
304 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Salesforce Best Practices
2 |
3 | ### Salesforce Best Practices Wiki
4 |
5 | Check out the wiki for all the good stuff! It's an ever expanding and evolving wiki so some files may not be complete or be in the process of being updated at any given time
6 |
7 | [Salesforce Best Practices Wiki](https://github.com/Coding-With-The-Force/SalesforceBestPractices/wiki)
8 |
9 | ***
10 |
11 | ### How to Say Thanks
12 |
13 | If you enjoy this repo and would like to say thank you, feel free to [send a donation here](https://www.paypal.com/donate?business=RNHEF8ZWKKLDG¤cy_code=USD)! But no pressure, I really just do this for fun!
14 |
--------------------------------------------------------------------------------
/Util_DML_Operations.cls:
--------------------------------------------------------------------------------
1 | /**
2 | * @description This utility class is intended to become a single point (where appropriate) for DML operations to occur.
3 | * The primary purpose of this is to ensure proper logging, error handling and reduction in code duplication.
4 | *
5 | *@author Matt Gerry matt.e.gerry@accenturefederal.com
6 | *@date 7/13/2020
7 | */
8 |
9 | public with sharing class Util_DML_Operations
10 | {
11 | private static final String SUCCESS = 'Success';
12 |
13 | /**
14 | * @description Takes list of SObjects and attempts an "AllOrNone = true" (default operation) delete operation.
15 | * @example deleteOperationAllOrNone(SObjectListToDelete, 'theCallingClass', 'theCallingMethod'
16 | * @return String
17 | */
18 | public String deleteOperationAllOrNone(List deletionList, String callingClass, String callingMethod)
19 | {
20 | try
21 | {
22 | database.delete(deletionList);
23 | return SUCCESS;
24 | }
25 | catch(Exception except)
26 | {
27 | Util_Error_Logger.insertNewErrorLog(except, callingClass, callingMethod);
28 | return except.getMessage();
29 | }
30 | }
31 |
32 | /**
33 | * @description Takes list of SObjects and attempts an "AllOrNone = false" delete operation.
34 | * @example deleteOperationAllOrNoneFalse(SObjectListToDelete, 'theCallingClass', 'theCallingMethod'
35 | * @return string
36 | */
37 | public String deleteOperationAllOrNoneFalse(List deletionList, String callingClass, String callingMethod)
38 | {
39 | System.debug('DeletionList: ' + deletionList);
40 | Database.DeleteResult[] deleteResult = database.delete(deletionList, false);
41 | String result = processDeleteResult(deleteResult, callingClass, callingMethod);
42 | return result;
43 | }
44 |
45 | /**
46 | * @description Takes list of SObjects and attempts an "AllOrNone = true" (default operation) insert operation.
47 | * @example insertOperationAllOrNone(SObjectListToDelete, 'theCallingClass', 'theCallingMethod'
48 | * @return string
49 | */
50 | public String insertOperationAllOrNone(List insertionList, String callingClass, String callingMethod)
51 | {
52 | try
53 | {
54 | database.insert(insertionList);
55 | return SUCCESS;
56 | }
57 | catch(Exception except)
58 | {
59 | Util_Error_Logger.insertNewErrorLog(except, callingClass, callingMethod);
60 | return except.getMessage();
61 | }
62 | }
63 |
64 | /**
65 | * @description Takes list of SObjects and attempts an "AllOrNone = false" insert operation.
66 | * @example insertOperationAllOrNoneFalse(SObjectListToDelete, 'theCallingClass', 'theCallingMethod'
67 | * @return string
68 | */
69 | public String insertOperationAllOrNoneFalse(List insertionList, String callingClass, String callingMethod)
70 | {
71 | Database.SaveResult[] saveResults = Database.insert(insertionList, false);
72 | String result = processSaveResult(saveResults, callingClass, callingMethod);
73 | return result;
74 | }
75 |
76 | /**
77 | * @description Takes list of SObjects and attempts an "AllOrNone = false" update operation.
78 | * @example updateOperationAllOrNone(SObjectListToDelete, 'theCallingClass', 'theCallingMethod'
79 | * @return string
80 | */
81 | public String updateOperationAllOrNone(List updateList, String callingClass, String callingMethod)
82 | {
83 | try
84 | {
85 | database.update(updateList);
86 | return SUCCESS;
87 |
88 | }
89 | catch(Exception except)
90 | {
91 | Util_Error_Logger.insertNewErrorLog(except, callingClass, callingMethod);
92 | return except.getMessage();
93 | }
94 | }
95 |
96 | /**
97 | * @description Takes list of SObjects and attempts an "AllOrNone = false" update operation.
98 | * @example updateOperationAllOrNoneFalse(SObjectListToDelete, 'theCallingClass', 'theCallingMethod'
99 | * @return string
100 | */
101 | public String updateOperationAllOrNoneFalse(List updateList, String callingClass, String callingMethod)
102 | {
103 | Database.SaveResult[] saveResults = Database.insert(updateList, false);
104 | String result = processSaveResult(saveResults, callingClass, callingMethod);
105 | return result;
106 | }
107 |
108 | /**
109 | * @description Takes a SaveResult aggregation and processes the results whether success of failure, including logging any errors
110 | * @example processSaveResult(saveResultObject, 'The Calling Class', 'The Calling Method')
111 | * @return string
112 | */
113 | private String processSaveResult(Database.SaveResult[] saveResults, String callingClass, String callingMethod)
114 | {
115 | String returnMessage = SUCCESS;
116 | List errorRecordDetailsList = new List();
117 | Error_Log__c loggedError = new Error_Log__c();
118 |
119 | Boolean insertParentError = true;
120 |
121 | for (Database.SaveResult saveResult : saveResults)
122 | {
123 | if (!saveResult.isSuccess())
124 | {
125 | String errorMessages = '';
126 |
127 | if(insertParentError)
128 | {
129 | loggedError = Util_Error_Logger.insertNewErrorLog(null, callingClass, callingMethod);
130 | insertParentError = false;
131 | }
132 |
133 | for (Database.Error error : saveResult.getErrors())
134 | {
135 | System.debug('DML Err: ' + String.valueOf(error.getStatusCode()) + ' ' + error.getMessage().left(99));
136 | errorRecordDetailsList.add(Util_Error_Logger.createErrorRecordDetail(loggedError.Id, error, saveResult.getId()));
137 | errorMessages += ' ' + error.getMessage();
138 | }
139 |
140 | returnMessage = errorMessages;
141 | }
142 | }
143 |
144 | Util_Error_Logger.insertErrorRecordDetails(errorRecordDetailsList);
145 |
146 | return returnMessage;
147 | }
148 |
149 | /**
150 | * @description Takes a DeleteResult aggregation and processes the results whether success of failure, including logging any errors
151 | * @example processDeleteResult(deleteResultObject, 'The Calling Class', 'The Calling Method')
152 | * @return string
153 | */
154 | private String processDeleteResult(Database.DeleteResult[] deleteResults, String callingClass, String callingMethod)
155 | {
156 | String returnMessage = SUCCESS;
157 | List errorRecordDetailsList = new List();
158 | Error_Log__c loggedError = new Error_Log__c();
159 |
160 | Boolean insertParentError = true;
161 |
162 | for (Database.DeleteResult deleteResult : deleteResults)
163 | {
164 | if (!deleteResult.isSuccess())
165 | {
166 | String errorMessages = '';
167 |
168 | if(insertParentError)
169 | {
170 | loggedError = Util_Error_Logger.insertNewErrorLog(null, callingClass, callingMethod);
171 | insertParentError = false;
172 | }
173 |
174 | for (Database.Error error : deleteResult.getErrors())
175 | {
176 | errorRecordDetailsList.add(Util_Error_Logger.createErrorRecordDetail(loggedError.Id, error, deleteResult.getId()));
177 | errorMessages += ' ' + error.getMessage();
178 | }
179 | returnMessage = errorMessages;
180 | }
181 | }
182 |
183 | Util_Error_Logger.insertErrorRecordDetails(errorRecordDetailsList);
184 |
185 | return returnMessage;
186 | }
187 | }
188 |
--------------------------------------------------------------------------------
/Util_Error_Logger.cls:
--------------------------------------------------------------------------------
1 | /**
2 | * Created by gerry on 8/3/2020.
3 | */
4 |
5 | public with sharing class Util_Error_Logger
6 | {
7 | public static Error_Log__c insertNewErrorLog(Exception exceptionPassed, String className, String methodName)
8 | {
9 | Error_Log__c newError = new Error_Log__c();
10 |
11 | if(exceptionPassed != null)
12 | {
13 | newError.Line_Number__c = exceptionPassed.getLineNumber();
14 | newError.Error_Description__c = exceptionPassed.getMessage();
15 | newError.Stack_Trace__c = exceptionPassed.getStackTraceString();
16 | }
17 |
18 | newError.Class_Name__c = className;
19 | newError.Method__c = methodName;
20 |
21 | insert newError;
22 |
23 | return newError;
24 | }
25 |
26 | public static void insertErrorRecordDetails(List errorRecordDetailList)
27 | {
28 | Database.insert(errorRecordDetailList);
29 | }
30 |
31 | public static Error_Record_Detail__c createErrorRecordDetail(Id logId, Database.Error err, String recordId)
32 | {
33 | Error_Record_Detail__c errorDetail = new Error_Record_Detail__c();
34 | errorDetail.Error_Log__c = logId;
35 | errorDetail.Record_Id__c = recordId;
36 | errorDetail.Error_Messages__c = err.getMessage();
37 | errorDetail.Status_Code__c = String.valueOf(err.getStatusCode());
38 | return errorDetail;
39 | }
40 | }
--------------------------------------------------------------------------------
/Util_Process_Builder_Terminator.cls:
--------------------------------------------------------------------------------
1 | /**
2 | * @description This utility class it used to terminate process builders when necessary. To my knowledge this is the cleanest way to exit a process builder.
3 | * @author Matt Gerry
4 | * @date 06/05/2020.
5 | */
6 |
7 | public with sharing class Util_Process_Builder_Terminator
8 | {
9 | @InvocableMethod(Label='Terminate Process Builder' Description='Terminate Process Builder')
10 | public static void terminateProcessBuilder() {}
11 | }
--------------------------------------------------------------------------------
/Util_Process_Builder_Trigger_Bypass.cls:
--------------------------------------------------------------------------------
1 | /**
2 | * @description This utility class it for allowing the process builder to bypass a trigger that utilizes the TriggerHandler framework. Pass it the name of the trigger handler to bypass it.
3 | * @author Matt Gerry
4 | * @date 06/05/2020.
5 | */
6 |
7 | public with sharing class Util_Process_Builder_Trigger_Bypass
8 | {
9 | @InvocableMethod(label = 'Process Builder Trigger Bypass' description = 'Invocable method used to stop triggers from running when process builder insert or update actions occur')
10 | public static void stopTriggers(List triggerHandlerName)
11 | {
12 | TriggerHandler.bypass(triggerHandlerName[0]);
13 | }
14 | }
--------------------------------------------------------------------------------
/Util_Process_Builder_Trigger_Restart.cls:
--------------------------------------------------------------------------------
1 | /**
2 | * @description This utility class it for allowing the process builder to restart a trigger that utilizes the TriggerHandler framework. Pass it the name of the trigger handler to restart it.
3 | * @author Matt Gerry
4 | * @date 07/02/2020.
5 | */
6 | public with sharing class Util_Process_Builder_Trigger_Restart
7 | {
8 | @InvocableMethod(label = 'Process Builder Trigger Restart' description = 'Invocable method used to allow triggers to fire again')
9 | public static void startTriggers(List triggerHandlerName)
10 | {
11 | TriggerHandler.clearBypass(triggerHandlerName[0]);
12 | }
13 | }
--------------------------------------------------------------------------------
/apexRules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
8 |
9 | Apex Code Health Check
10 |
11 |
12 |
13 |
14 | 3
15 |
16 | Assertions in test classes should always provide a message. Please add a message to your assertion.
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | 1
25 |
26 | All test methods should have assertions in them. You must go back and add appropriate assertions to your test methods.
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | 1
35 |
36 | You need the @isTest annotation above all test methods please.
37 |
38 |
39 |
44 |
45 |
46 |
47 |
48 | 1
49 |
50 | See All Data = true should never be utilized in test classes. Please remove it and use the ObjectCreator to create test data.
51 |
52 |
53 |
61 |
62 |
63 |
64 |
65 | 3
66 |
67 | Avoid the global modifier wherever possible. Use it only when absolutely necessary. The global declaration is a security risk due to accessibility.
68 |
69 |
70 |
73 |
74 |
75 |
76 |
77 | 1
78 |
79 | Never put logic in a trigger. Utilize the TriggerHandler virtual class. Utilizing this framework is much cleaner and allows for easier testing of the trigger. More info the framework can be found here: https://github.com/kevinohara80/sfdc-trigger-framework
80 |
81 |
82 | objectOldMap;
93 | private List
132 |
133 |
134 |
135 | 4
136 |
137 | Please follow pascal case rules when naming your classes.
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 | 4
146 |
147 | Please camel case your field names appropritately.
148 |
149 |
150 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 | 4
166 |
167 | Please always utilizes braces with your for loops.
168 |
169 |
170 |
173 |
174 |
175 |
176 |
177 | 4
178 |
179 | Please camel case your parameter names appropriately.
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 | 4
188 |
189 | Please always utilizes braces with your if else statements.
190 |
191 |
192 |
198 |
199 |
200 |
201 |
202 | 4
203 |
204 | Please always utilizes braces with your if else statements.
205 |
206 |
207 |
213 |
214 |
215 |
216 |
217 | 4
218 |
219 | Please camel case your local method variables.
220 |
221 |
222 |
226 |
227 |
228 |
229 |
230 |
231 |
232 |
233 |
234 | 4
235 |
236 | Please camel case your method names.
237 |
238 |
239 |
243 |
244 |
245 |
246 |
247 | 4
248 |
249 |
250 |
251 |
252 |
253 |
254 |
255 |
256 |
257 |
258 |
259 |
260 |
261 |
262 |
263 |
264 |
265 |
266 |
267 |
268 |
269 |
270 |
271 |
272 |
273 |
274 |
275 |
276 |
277 |
278 |
279 |
280 |
281 |
282 |
283 |
284 |
285 |
286 |
287 |
288 |
289 |
290 |
291 |
292 |
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
301 |
302 |
303 |
304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 |
312 |
313 |
314 |
315 |
316 |
317 |
318 |
319 |
320 |
--------------------------------------------------------------------------------
/uncrustify.cfg:
--------------------------------------------------------------------------------
1 | # Uncrustify-0.71.0_f
2 |
3 | #
4 | # General options
5 | #
6 |
7 | # The type of line endings.
8 | #
9 | # Default: auto
10 | newlines = auto # lf/crlf/cr/auto
11 |
12 | # The original size of tabs in the input.
13 | #
14 | # Default: 8
15 | input_tab_size = 8 # unsigned number
16 |
17 | # The size of tabs in the output (only used if align_with_tabs=true).
18 | #
19 | # Default: 8
20 | output_tab_size = 8 # unsigned number
21 |
22 | # The ASCII value of the string escape char, usually 92 (\) or (Pawn) 94 (^).
23 | #
24 | # Default: 92
25 | string_escape_char = 92 # unsigned number
26 |
27 | # Alternate string escape char (usually only used for Pawn).
28 | # Only works right before the quote char.
29 | string_escape_char2 = 0 # unsigned number
30 |
31 | # Replace tab characters found in string literals with the escape sequence \t
32 | # instead.
33 | string_replace_tab_chars = false # true/false
34 |
35 | # Allow interpreting '>=' and '>>=' as part of a template in code like
36 | # 'void f(list>=val);'. If true, 'assert(x<0 && y>=3)' will be broken.
37 | # Improvements to template detection may make this option obsolete.
38 | tok_split_gte = false # true/false
39 |
40 | # Disable formatting of NL_CONT ('\\n') ended lines (e.g. multiline macros)
41 | disable_processing_nl_cont = false # true/false
42 |
43 | # Specify the marker used in comments to disable processing of part of the
44 | # file.
45 | # The comment should be used alone in one line.
46 | #
47 | # Default: *INDENT-OFF*
48 | disable_processing_cmt = " *INDENT-OFF*" # string
49 |
50 | # Specify the marker used in comments to (re)enable processing in a file.
51 | # The comment should be used alone in one line.
52 | #
53 | # Default: *INDENT-ON*
54 | enable_processing_cmt = " *INDENT-ON*" # string
55 |
56 | # Enable parsing of digraphs.
57 | enable_digraphs = false # true/false
58 |
59 | # Add or remove the UTF-8 BOM (recommend 'remove').
60 | utf8_bom = ignore # ignore/add/remove/force
61 |
62 | # If the file contains bytes with values between 128 and 255, but is not
63 | # UTF-8, then output as UTF-8.
64 | utf8_byte = false # true/false
65 |
66 | # Force the output encoding to UTF-8.
67 | utf8_force = false # true/false
68 |
69 | # Add or remove space between 'do' and '{'.
70 | sp_do_brace_open = ignore # ignore/add/remove/force
71 |
72 | # Add or remove space between '}' and 'while'.
73 | sp_brace_close_while = ignore # ignore/add/remove/force
74 |
75 | # Add or remove space between 'while' and '('.
76 | sp_while_paren_open = ignore # ignore/add/remove/force
77 |
78 | #
79 | # Spacing options
80 | #
81 |
82 | # Add or remove space around non-assignment symbolic operators ('+', '/', '%',
83 | # '<<', and so forth).
84 | sp_arith = ignore # ignore/add/remove/force
85 |
86 | # Add or remove space around arithmetic operators '+' and '-'.
87 | #
88 | # Overrides sp_arith.
89 | sp_arith_additive = ignore # ignore/add/remove/force
90 |
91 | # Add or remove space around assignment operator '=', '+=', etc.
92 | sp_assign = ignore # ignore/add/remove/force
93 |
94 | # Add or remove space around '=' in C++11 lambda capture specifications.
95 | #
96 | # Overrides sp_assign.
97 | sp_cpp_lambda_assign = ignore # ignore/add/remove/force
98 |
99 | # Add or remove space after the capture specification of a C++11 lambda when
100 | # an argument list is present, as in '[] (int x){ ... }'.
101 | sp_cpp_lambda_square_paren = ignore # ignore/add/remove/force
102 |
103 | # Add or remove space after the capture specification of a C++11 lambda with
104 | # no argument list is present, as in '[] { ... }'.
105 | sp_cpp_lambda_square_brace = ignore # ignore/add/remove/force
106 |
107 | # Add or remove space after the argument list of a C++11 lambda, as in
108 | # '[](int x) { ... }'.
109 | sp_cpp_lambda_paren_brace = ignore # ignore/add/remove/force
110 |
111 | # Add or remove space between a lambda body and its call operator of an
112 | # immediately invoked lambda, as in '[]( ... ){ ... } ( ... )'.
113 | sp_cpp_lambda_fparen = ignore # ignore/add/remove/force
114 |
115 | # Add or remove space around assignment operator '=' in a prototype.
116 | #
117 | # If set to ignore, use sp_assign.
118 | sp_assign_default = ignore # ignore/add/remove/force
119 |
120 | # Add or remove space before assignment operator '=', '+=', etc.
121 | #
122 | # Overrides sp_assign.
123 | sp_before_assign = ignore # ignore/add/remove/force
124 |
125 | # Add or remove space after assignment operator '=', '+=', etc.
126 | #
127 | # Overrides sp_assign.
128 | sp_after_assign = ignore # ignore/add/remove/force
129 |
130 | # Add or remove space in 'NS_ENUM ('.
131 | sp_enum_paren = ignore # ignore/add/remove/force
132 |
133 | # Add or remove space around assignment '=' in enum.
134 | sp_enum_assign = ignore # ignore/add/remove/force
135 |
136 | # Add or remove space before assignment '=' in enum.
137 | #
138 | # Overrides sp_enum_assign.
139 | sp_enum_before_assign = ignore # ignore/add/remove/force
140 |
141 | # Add or remove space after assignment '=' in enum.
142 | #
143 | # Overrides sp_enum_assign.
144 | sp_enum_after_assign = ignore # ignore/add/remove/force
145 |
146 | # Add or remove space around assignment ':' in enum.
147 | sp_enum_colon = ignore # ignore/add/remove/force
148 |
149 | # Add or remove space around preprocessor '##' concatenation operator.
150 | #
151 | # Default: add
152 | sp_pp_concat = add # ignore/add/remove/force
153 |
154 | # Add or remove space after preprocessor '#' stringify operator.
155 | # Also affects the '#@' charizing operator.
156 | sp_pp_stringify = ignore # ignore/add/remove/force
157 |
158 | # Add or remove space before preprocessor '#' stringify operator
159 | # as in '#define x(y) L#y'.
160 | sp_before_pp_stringify = ignore # ignore/add/remove/force
161 |
162 | # Add or remove space around boolean operators '&&' and '||'.
163 | sp_bool = ignore # ignore/add/remove/force
164 |
165 | # Add or remove space around compare operator '<', '>', '==', etc.
166 | sp_compare = ignore # ignore/add/remove/force
167 |
168 | # Add or remove space inside '(' and ')'.
169 | sp_inside_paren = ignore # ignore/add/remove/force
170 |
171 | # Add or remove space between nested parentheses, i.e. '((' vs. ') )'.
172 | sp_paren_paren = ignore # ignore/add/remove/force
173 |
174 | # Add or remove space between back-to-back parentheses, i.e. ')(' vs. ') ('.
175 | sp_cparen_oparen = ignore # ignore/add/remove/force
176 |
177 | # Whether to balance spaces inside nested parentheses.
178 | sp_balance_nested_parens = false # true/false
179 |
180 | # Add or remove space between ')' and '{'.
181 | sp_paren_brace = ignore # ignore/add/remove/force
182 |
183 | # Add or remove space between nested braces, i.e. '{{' vs '{ {'.
184 | sp_brace_brace = ignore # ignore/add/remove/force
185 |
186 | # Add or remove space before pointer star '*'.
187 | sp_before_ptr_star = ignore # ignore/add/remove/force
188 |
189 | # Add or remove space before pointer star '*' that isn't followed by a
190 | # variable name. If set to ignore, sp_before_ptr_star is used instead.
191 | sp_before_unnamed_ptr_star = ignore # ignore/add/remove/force
192 |
193 | # Add or remove space between pointer stars '*'.
194 | sp_between_ptr_star = ignore # ignore/add/remove/force
195 |
196 | # Add or remove space after pointer star '*', if followed by a word.
197 | #
198 | # Overrides sp_type_func.
199 | sp_after_ptr_star = ignore # ignore/add/remove/force
200 |
201 | # Add or remove space after pointer caret '^', if followed by a word.
202 | sp_after_ptr_block_caret = ignore # ignore/add/remove/force
203 |
204 | # Add or remove space after pointer star '*', if followed by a qualifier.
205 | sp_after_ptr_star_qualifier = ignore # ignore/add/remove/force
206 |
207 | # Add or remove space after a pointer star '*', if followed by a function
208 | # prototype or function definition.
209 | #
210 | # Overrides sp_after_ptr_star and sp_type_func.
211 | sp_after_ptr_star_func = ignore # ignore/add/remove/force
212 |
213 | # Add or remove space after a pointer star '*', if followed by an open
214 | # parenthesis, as in 'void* (*)().
215 | sp_ptr_star_paren = ignore # ignore/add/remove/force
216 |
217 | # Add or remove space before a pointer star '*', if followed by a function
218 | # prototype or function definition.
219 | sp_before_ptr_star_func = ignore # ignore/add/remove/force
220 |
221 | # Add or remove space before a reference sign '&'.
222 | sp_before_byref = ignore # ignore/add/remove/force
223 |
224 | # Add or remove space before a reference sign '&' that isn't followed by a
225 | # variable name. If set to ignore, sp_before_byref is used instead.
226 | sp_before_unnamed_byref = ignore # ignore/add/remove/force
227 |
228 | # Add or remove space after reference sign '&', if followed by a word.
229 | #
230 | # Overrides sp_type_func.
231 | sp_after_byref = ignore # ignore/add/remove/force
232 |
233 | # Add or remove space after a reference sign '&', if followed by a function
234 | # prototype or function definition.
235 | #
236 | # Overrides sp_after_byref and sp_type_func.
237 | sp_after_byref_func = ignore # ignore/add/remove/force
238 |
239 | # Add or remove space before a reference sign '&', if followed by a function
240 | # prototype or function definition.
241 | sp_before_byref_func = ignore # ignore/add/remove/force
242 |
243 | # Add or remove space between type and word.
244 | #
245 | # Default: force
246 | sp_after_type = force # ignore/add/remove/force
247 |
248 | # Add or remove space between 'decltype(...)' and word.
249 | sp_after_decltype = ignore # ignore/add/remove/force
250 |
251 | # (D) Add or remove space before the parenthesis in the D constructs
252 | # 'template Foo(' and 'class Foo('.
253 | sp_before_template_paren = ignore # ignore/add/remove/force
254 |
255 | # Add or remove space between 'template' and '<'.
256 | # If set to ignore, sp_before_angle is used.
257 | sp_template_angle = ignore # ignore/add/remove/force
258 |
259 | # Add or remove space before '<'.
260 | sp_before_angle = ignore # ignore/add/remove/force
261 |
262 | # Add or remove space inside '<' and '>'.
263 | sp_inside_angle = ignore # ignore/add/remove/force
264 |
265 | # Add or remove space inside '<>'.
266 | sp_inside_angle_empty = ignore # ignore/add/remove/force
267 |
268 | # Add or remove space between '>' and ':'.
269 | sp_angle_colon = ignore # ignore/add/remove/force
270 |
271 | # Add or remove space after '>'.
272 | sp_after_angle = ignore # ignore/add/remove/force
273 |
274 | # Add or remove space between '>' and '(' as found in 'new List(foo);'.
275 | sp_angle_paren = ignore # ignore/add/remove/force
276 |
277 | # Add or remove space between '>' and '()' as found in 'new List();'.
278 | sp_angle_paren_empty = ignore # ignore/add/remove/force
279 |
280 | # Add or remove space between '>' and a word as in 'List m;' or
281 | # 'template static ...'.
282 | sp_angle_word = ignore # ignore/add/remove/force
283 |
284 | # Add or remove space between '>' and '>' in '>>' (template stuff).
285 | #
286 | # Default: add
287 | sp_angle_shift = add # ignore/add/remove/force
288 |
289 | # (C++11) Permit removal of the space between '>>' in 'foo >'. Note
290 | # that sp_angle_shift cannot remove the space without this option.
291 | sp_permit_cpp11_shift = false # true/false
292 |
293 | # Add or remove space before '(' of control statements ('if', 'for', 'switch',
294 | # 'while', etc.).
295 | sp_before_sparen = ignore # ignore/add/remove/force
296 |
297 | # Add or remove space inside '(' and ')' of control statements.
298 | sp_inside_sparen = ignore # ignore/add/remove/force
299 |
300 | # Add or remove space after '(' of control statements.
301 | #
302 | # Overrides sp_inside_sparen.
303 | sp_inside_sparen_open = ignore # ignore/add/remove/force
304 |
305 | # Add or remove space before ')' of control statements.
306 | #
307 | # Overrides sp_inside_sparen.
308 | sp_inside_sparen_close = ignore # ignore/add/remove/force
309 |
310 | # Add or remove space after ')' of control statements.
311 | sp_after_sparen = ignore # ignore/add/remove/force
312 |
313 | # Add or remove space between ')' and '{' of of control statements.
314 | sp_sparen_brace = ignore # ignore/add/remove/force
315 |
316 | # (D) Add or remove space between 'invariant' and '('.
317 | sp_invariant_paren = ignore # ignore/add/remove/force
318 |
319 | # (D) Add or remove space after the ')' in 'invariant (C) c'.
320 | sp_after_invariant_paren = ignore # ignore/add/remove/force
321 |
322 | # Add or remove space before empty statement ';' on 'if', 'for' and 'while'.
323 | sp_special_semi = ignore # ignore/add/remove/force
324 |
325 | # Add or remove space before ';'.
326 | #
327 | # Default: remove
328 | sp_before_semi = remove # ignore/add/remove/force
329 |
330 | # Add or remove space before ';' in non-empty 'for' statements.
331 | sp_before_semi_for = ignore # ignore/add/remove/force
332 |
333 | # Add or remove space before a semicolon of an empty part of a for statement.
334 | sp_before_semi_for_empty = ignore # ignore/add/remove/force
335 |
336 | # Add or remove space after ';', except when followed by a comment.
337 | #
338 | # Default: add
339 | sp_after_semi = add # ignore/add/remove/force
340 |
341 | # Add or remove space after ';' in non-empty 'for' statements.
342 | #
343 | # Default: force
344 | sp_after_semi_for = force # ignore/add/remove/force
345 |
346 | # Add or remove space after the final semicolon of an empty part of a for
347 | # statement, as in 'for ( ; ; )'.
348 | sp_after_semi_for_empty = ignore # ignore/add/remove/force
349 |
350 | # Add or remove space before '[' (except '[]').
351 | sp_before_square = ignore # ignore/add/remove/force
352 |
353 | # Add or remove space before '[' for a variable definition.
354 | #
355 | # Default: remove
356 | sp_before_vardef_square = remove # ignore/add/remove/force
357 |
358 | # Add or remove space before '[' for asm block.
359 | sp_before_square_asm_block = ignore # ignore/add/remove/force
360 |
361 | # Add or remove space before '[]'.
362 | sp_before_squares = ignore # ignore/add/remove/force
363 |
364 | # Add or remove space before C++17 structured bindings.
365 | sp_cpp_before_struct_binding = ignore # ignore/add/remove/force
366 |
367 | # Add or remove space inside a non-empty '[' and ']'.
368 | sp_inside_square = ignore # ignore/add/remove/force
369 |
370 | # (OC) Add or remove space inside a non-empty Objective-C boxed array '@[' and
371 | # ']'. If set to ignore, sp_inside_square is used.
372 | sp_inside_square_oc_array = ignore # ignore/add/remove/force
373 |
374 | # Add or remove space after ',', i.e. 'a,b' vs. 'a, b'.
375 | sp_after_comma = ignore # ignore/add/remove/force
376 |
377 | # Add or remove space before ','.
378 | #
379 | # Default: remove
380 | sp_before_comma = remove # ignore/add/remove/force
381 |
382 | # (C#) Add or remove space between ',' and ']' in multidimensional array type
383 | # like 'int[,,]'.
384 | sp_after_mdatype_commas = ignore # ignore/add/remove/force
385 |
386 | # (C#) Add or remove space between '[' and ',' in multidimensional array type
387 | # like 'int[,,]'.
388 | sp_before_mdatype_commas = ignore # ignore/add/remove/force
389 |
390 | # (C#) Add or remove space between ',' in multidimensional array type
391 | # like 'int[,,]'.
392 | sp_between_mdatype_commas = ignore # ignore/add/remove/force
393 |
394 | # Add or remove space between an open parenthesis and comma,
395 | # i.e. '(,' vs. '( ,'.
396 | #
397 | # Default: force
398 | sp_paren_comma = force # ignore/add/remove/force
399 |
400 | # Add or remove space before the variadic '...' when preceded by a
401 | # non-punctuator.
402 | sp_before_ellipsis = ignore # ignore/add/remove/force
403 |
404 | # Add or remove space between a type and '...'.
405 | sp_type_ellipsis = ignore # ignore/add/remove/force
406 |
407 | # (D) Add or remove space between a type and '?'.
408 | sp_type_question = ignore # ignore/add/remove/force
409 |
410 | # Add or remove space between ')' and '...'.
411 | sp_paren_ellipsis = ignore # ignore/add/remove/force
412 |
413 | # Add or remove space between ')' and a qualifier such as 'const'.
414 | sp_paren_qualifier = ignore # ignore/add/remove/force
415 |
416 | # Add or remove space between ')' and 'noexcept'.
417 | sp_paren_noexcept = ignore # ignore/add/remove/force
418 |
419 | # Add or remove space after class ':'.
420 | sp_after_class_colon = ignore # ignore/add/remove/force
421 |
422 | # Add or remove space before class ':'.
423 | sp_before_class_colon = ignore # ignore/add/remove/force
424 |
425 | # Add or remove space after class constructor ':'.
426 | sp_after_constr_colon = ignore # ignore/add/remove/force
427 |
428 | # Add or remove space before class constructor ':'.
429 | sp_before_constr_colon = ignore # ignore/add/remove/force
430 |
431 | # Add or remove space before case ':'.
432 | #
433 | # Default: remove
434 | sp_before_case_colon = remove # ignore/add/remove/force
435 |
436 | # Add or remove space between 'operator' and operator sign.
437 | sp_after_operator = ignore # ignore/add/remove/force
438 |
439 | # Add or remove space between the operator symbol and the open parenthesis, as
440 | # in 'operator ++('.
441 | sp_after_operator_sym = ignore # ignore/add/remove/force
442 |
443 | # Overrides sp_after_operator_sym when the operator has no arguments, as in
444 | # 'operator *()'.
445 | sp_after_operator_sym_empty = ignore # ignore/add/remove/force
446 |
447 | # Add or remove space after C/D cast, i.e. 'cast(int)a' vs. 'cast(int) a' or
448 | # '(int)a' vs. '(int) a'.
449 | sp_after_cast = ignore # ignore/add/remove/force
450 |
451 | # Add or remove spaces inside cast parentheses.
452 | sp_inside_paren_cast = ignore # ignore/add/remove/force
453 |
454 | # Add or remove space between the type and open parenthesis in a C++ cast,
455 | # i.e. 'int(exp)' vs. 'int (exp)'.
456 | sp_cpp_cast_paren = ignore # ignore/add/remove/force
457 |
458 | # Add or remove space between 'sizeof' and '('.
459 | sp_sizeof_paren = ignore # ignore/add/remove/force
460 |
461 | # Add or remove space between 'sizeof' and '...'.
462 | sp_sizeof_ellipsis = ignore # ignore/add/remove/force
463 |
464 | # Add or remove space between 'sizeof...' and '('.
465 | sp_sizeof_ellipsis_paren = ignore # ignore/add/remove/force
466 |
467 | # Add or remove space between 'decltype' and '('.
468 | sp_decltype_paren = ignore # ignore/add/remove/force
469 |
470 | # (Pawn) Add or remove space after the tag keyword.
471 | sp_after_tag = ignore # ignore/add/remove/force
472 |
473 | # Add or remove space inside enum '{' and '}'.
474 | sp_inside_braces_enum = ignore # ignore/add/remove/force
475 |
476 | # Add or remove space inside struct/union '{' and '}'.
477 | sp_inside_braces_struct = ignore # ignore/add/remove/force
478 |
479 | # (OC) Add or remove space inside Objective-C boxed dictionary '{' and '}'
480 | sp_inside_braces_oc_dict = ignore # ignore/add/remove/force
481 |
482 | # Add or remove space after open brace in an unnamed temporary
483 | # direct-list-initialization.
484 | sp_after_type_brace_init_lst_open = ignore # ignore/add/remove/force
485 |
486 | # Add or remove space before close brace in an unnamed temporary
487 | # direct-list-initialization.
488 | sp_before_type_brace_init_lst_close = ignore # ignore/add/remove/force
489 |
490 | # Add or remove space inside an unnamed temporary direct-list-initialization.
491 | sp_inside_type_brace_init_lst = ignore # ignore/add/remove/force
492 |
493 | # Add or remove space inside '{' and '}'.
494 | sp_inside_braces = ignore # ignore/add/remove/force
495 |
496 | # Add or remove space inside '{}'.
497 | sp_inside_braces_empty = ignore # ignore/add/remove/force
498 |
499 | # Add or remove space around trailing return operator '->'.
500 | sp_trailing_return = ignore # ignore/add/remove/force
501 |
502 | # Add or remove space between return type and function name. A minimum of 1
503 | # is forced except for pointer return types.
504 | sp_type_func = ignore # ignore/add/remove/force
505 |
506 | # Add or remove space between type and open brace of an unnamed temporary
507 | # direct-list-initialization.
508 | sp_type_brace_init_lst = ignore # ignore/add/remove/force
509 |
510 | # Add or remove space between function name and '(' on function declaration.
511 | sp_func_proto_paren = ignore # ignore/add/remove/force
512 |
513 | # Add or remove space between function name and '()' on function declaration
514 | # without parameters.
515 | sp_func_proto_paren_empty = ignore # ignore/add/remove/force
516 |
517 | # Add or remove space between function name and '(' with a typedef specifier.
518 | sp_func_type_paren = ignore # ignore/add/remove/force
519 |
520 | # Add or remove space between alias name and '(' of a non-pointer function type typedef.
521 | sp_func_def_paren = ignore # ignore/add/remove/force
522 |
523 | # Add or remove space between function name and '()' on function definition
524 | # without parameters.
525 | sp_func_def_paren_empty = ignore # ignore/add/remove/force
526 |
527 | # Add or remove space inside empty function '()'.
528 | # Overrides sp_after_angle unless use_sp_after_angle_always is set to true.
529 | sp_inside_fparens = ignore # ignore/add/remove/force
530 |
531 | # Add or remove space inside function '(' and ')'.
532 | sp_inside_fparen = ignore # ignore/add/remove/force
533 |
534 | # Add or remove space inside the first parentheses in a function type, as in
535 | # 'void (*x)(...)'.
536 | sp_inside_tparen = ignore # ignore/add/remove/force
537 |
538 | # Add or remove space between the ')' and '(' in a function type, as in
539 | # 'void (*x)(...)'.
540 | sp_after_tparen_close = ignore # ignore/add/remove/force
541 |
542 | # Add or remove space between ']' and '(' when part of a function call.
543 | sp_square_fparen = ignore # ignore/add/remove/force
544 |
545 | # Add or remove space between ')' and '{' of function.
546 | sp_fparen_brace = ignore # ignore/add/remove/force
547 |
548 | # Add or remove space between ')' and '{' of s function call in object
549 | # initialization.
550 | #
551 | # Overrides sp_fparen_brace.
552 | sp_fparen_brace_initializer = ignore # ignore/add/remove/force
553 |
554 | # (Java) Add or remove space between ')' and '{{' of double brace initializer.
555 | sp_fparen_dbrace = ignore # ignore/add/remove/force
556 |
557 | # Add or remove space between function name and '(' on function calls.
558 | sp_func_call_paren = ignore # ignore/add/remove/force
559 |
560 | # Add or remove space between function name and '()' on function calls without
561 | # parameters. If set to ignore (the default), sp_func_call_paren is used.
562 | sp_func_call_paren_empty = ignore # ignore/add/remove/force
563 |
564 | # Add or remove space between the user function name and '(' on function
565 | # calls. You need to set a keyword to be a user function in the config file,
566 | # like:
567 | # set func_call_user tr _ i18n
568 | sp_func_call_user_paren = ignore # ignore/add/remove/force
569 |
570 | # Add or remove space inside user function '(' and ')'.
571 | sp_func_call_user_inside_fparen = ignore # ignore/add/remove/force
572 |
573 | # Add or remove space between nested parentheses with user functions,
574 | # i.e. '((' vs. '( ('.
575 | sp_func_call_user_paren_paren = ignore # ignore/add/remove/force
576 |
577 | # Add or remove space between a constructor/destructor and the open
578 | # parenthesis.
579 | sp_func_class_paren = ignore # ignore/add/remove/force
580 |
581 | # Add or remove space between a constructor without parameters or destructor
582 | # and '()'.
583 | sp_func_class_paren_empty = ignore # ignore/add/remove/force
584 |
585 | # Add or remove space between 'return' and '('.
586 | sp_return_paren = ignore # ignore/add/remove/force
587 |
588 | # Add or remove space between 'return' and '{'.
589 | sp_return_brace = ignore # ignore/add/remove/force
590 |
591 | # Add or remove space between '__attribute__' and '('.
592 | sp_attribute_paren = ignore # ignore/add/remove/force
593 |
594 | # Add or remove space between 'defined' and '(' in '#if defined (FOO)'.
595 | sp_defined_paren = ignore # ignore/add/remove/force
596 |
597 | # Add or remove space between 'throw' and '(' in 'throw (something)'.
598 | sp_throw_paren = ignore # ignore/add/remove/force
599 |
600 | # Add or remove space between 'throw' and anything other than '(' as in
601 | # '@throw [...];'.
602 | sp_after_throw = ignore # ignore/add/remove/force
603 |
604 | # Add or remove space between 'catch' and '(' in 'catch (something) { }'.
605 | # If set to ignore, sp_before_sparen is used.
606 | sp_catch_paren = ignore # ignore/add/remove/force
607 |
608 | # (OC) Add or remove space between '@catch' and '('
609 | # in '@catch (something) { }'. If set to ignore, sp_catch_paren is used.
610 | sp_oc_catch_paren = ignore # ignore/add/remove/force
611 |
612 | # (OC) Add or remove space before Objective-C protocol list
613 | # as in '@protocol Protocol' or '@interface MyClass : NSObject'.
614 | sp_before_oc_proto_list = ignore # ignore/add/remove/force
615 |
616 | # (OC) Add or remove space between class name and '('
617 | # in '@interface className(categoryName):BaseClass'
618 | sp_oc_classname_paren = ignore # ignore/add/remove/force
619 |
620 | # (D) Add or remove space between 'version' and '('
621 | # in 'version (something) { }'. If set to ignore, sp_before_sparen is used.
622 | sp_version_paren = ignore # ignore/add/remove/force
623 |
624 | # (D) Add or remove space between 'scope' and '('
625 | # in 'scope (something) { }'. If set to ignore, sp_before_sparen is used.
626 | sp_scope_paren = ignore # ignore/add/remove/force
627 |
628 | # Add or remove space between 'super' and '(' in 'super (something)'.
629 | #
630 | # Default: remove
631 | sp_super_paren = remove # ignore/add/remove/force
632 |
633 | # Add or remove space between 'this' and '(' in 'this (something)'.
634 | #
635 | # Default: remove
636 | sp_this_paren = remove # ignore/add/remove/force
637 |
638 | # Add or remove space between a macro name and its definition.
639 | sp_macro = ignore # ignore/add/remove/force
640 |
641 | # Add or remove space between a macro function ')' and its definition.
642 | sp_macro_func = ignore # ignore/add/remove/force
643 |
644 | # Add or remove space between 'else' and '{' if on the same line.
645 | sp_else_brace = ignore # ignore/add/remove/force
646 |
647 | # Add or remove space between '}' and 'else' if on the same line.
648 | sp_brace_else = ignore # ignore/add/remove/force
649 |
650 | # Add or remove space between '}' and the name of a typedef on the same line.
651 | sp_brace_typedef = ignore # ignore/add/remove/force
652 |
653 | # Add or remove space before the '{' of a 'catch' statement, if the '{' and
654 | # 'catch' are on the same line, as in 'catch (decl) {'.
655 | sp_catch_brace = ignore # ignore/add/remove/force
656 |
657 | # (OC) Add or remove space before the '{' of a '@catch' statement, if the '{'
658 | # and '@catch' are on the same line, as in '@catch (decl) {'.
659 | # If set to ignore, sp_catch_brace is used.
660 | sp_oc_catch_brace = ignore # ignore/add/remove/force
661 |
662 | # Add or remove space between '}' and 'catch' if on the same line.
663 | sp_brace_catch = ignore # ignore/add/remove/force
664 |
665 | # (OC) Add or remove space between '}' and '@catch' if on the same line.
666 | # If set to ignore, sp_brace_catch is used.
667 | sp_oc_brace_catch = ignore # ignore/add/remove/force
668 |
669 | # Add or remove space between 'finally' and '{' if on the same line.
670 | sp_finally_brace = ignore # ignore/add/remove/force
671 |
672 | # Add or remove space between '}' and 'finally' if on the same line.
673 | sp_brace_finally = ignore # ignore/add/remove/force
674 |
675 | # Add or remove space between 'try' and '{' if on the same line.
676 | sp_try_brace = ignore # ignore/add/remove/force
677 |
678 | # Add or remove space between get/set and '{' if on the same line.
679 | sp_getset_brace = ignore # ignore/add/remove/force
680 |
681 | # Add or remove space between a variable and '{' for C++ uniform
682 | # initialization.
683 | sp_word_brace_init_lst = ignore # ignore/add/remove/force
684 |
685 | # Add or remove space between a variable and '{' for a namespace.
686 | #
687 | # Default: add
688 | sp_word_brace_ns = add # ignore/add/remove/force
689 |
690 | # Add or remove space before the '::' operator.
691 | sp_before_dc = ignore # ignore/add/remove/force
692 |
693 | # Add or remove space after the '::' operator.
694 | sp_after_dc = ignore # ignore/add/remove/force
695 |
696 | # (D) Add or remove around the D named array initializer ':' operator.
697 | sp_d_array_colon = ignore # ignore/add/remove/force
698 |
699 | # Add or remove space after the '!' (not) unary operator.
700 | #
701 | # Default: remove
702 | sp_not = remove # ignore/add/remove/force
703 |
704 | # Add or remove space after the '~' (invert) unary operator.
705 | #
706 | # Default: remove
707 | sp_inv = remove # ignore/add/remove/force
708 |
709 | # Add or remove space after the '&' (address-of) unary operator. This does not
710 | # affect the spacing after a '&' that is part of a type.
711 | #
712 | # Default: remove
713 | sp_addr = remove # ignore/add/remove/force
714 |
715 | # Add or remove space around the '.' or '->' operators.
716 | #
717 | # Default: remove
718 | sp_member = remove # ignore/add/remove/force
719 |
720 | # Add or remove space after the '*' (dereference) unary operator. This does
721 | # not affect the spacing after a '*' that is part of a type.
722 | #
723 | # Default: remove
724 | sp_deref = remove # ignore/add/remove/force
725 |
726 | # Add or remove space after '+' or '-', as in 'x = -5' or 'y = +7'.
727 | #
728 | # Default: remove
729 | sp_sign = remove # ignore/add/remove/force
730 |
731 | # Add or remove space between '++' and '--' the word to which it is being
732 | # applied, as in '(--x)' or 'y++;'.
733 | #
734 | # Default: remove
735 | sp_incdec = remove # ignore/add/remove/force
736 |
737 | # Add or remove space before a backslash-newline at the end of a line.
738 | #
739 | # Default: add
740 | sp_before_nl_cont = add # ignore/add/remove/force
741 |
742 | # (OC) Add or remove space after the scope '+' or '-', as in '-(void) foo;'
743 | # or '+(int) bar;'.
744 | sp_after_oc_scope = ignore # ignore/add/remove/force
745 |
746 | # (OC) Add or remove space after the colon in message specs,
747 | # i.e. '-(int) f:(int) x;' vs. '-(int) f: (int) x;'.
748 | sp_after_oc_colon = ignore # ignore/add/remove/force
749 |
750 | # (OC) Add or remove space before the colon in message specs,
751 | # i.e. '-(int) f: (int) x;' vs. '-(int) f : (int) x;'.
752 | sp_before_oc_colon = ignore # ignore/add/remove/force
753 |
754 | # (OC) Add or remove space after the colon in immutable dictionary expression
755 | # 'NSDictionary *test = @{@"foo" :@"bar"};'.
756 | sp_after_oc_dict_colon = ignore # ignore/add/remove/force
757 |
758 | # (OC) Add or remove space before the colon in immutable dictionary expression
759 | # 'NSDictionary *test = @{@"foo" :@"bar"};'.
760 | sp_before_oc_dict_colon = ignore # ignore/add/remove/force
761 |
762 | # (OC) Add or remove space after the colon in message specs,
763 | # i.e. '[object setValue:1];' vs. '[object setValue: 1];'.
764 | sp_after_send_oc_colon = ignore # ignore/add/remove/force
765 |
766 | # (OC) Add or remove space before the colon in message specs,
767 | # i.e. '[object setValue:1];' vs. '[object setValue :1];'.
768 | sp_before_send_oc_colon = ignore # ignore/add/remove/force
769 |
770 | # (OC) Add or remove space after the (type) in message specs,
771 | # i.e. '-(int)f: (int) x;' vs. '-(int)f: (int)x;'.
772 | sp_after_oc_type = ignore # ignore/add/remove/force
773 |
774 | # (OC) Add or remove space after the first (type) in message specs,
775 | # i.e. '-(int) f:(int)x;' vs. '-(int)f:(int)x;'.
776 | sp_after_oc_return_type = ignore # ignore/add/remove/force
777 |
778 | # (OC) Add or remove space between '@selector' and '(',
779 | # i.e. '@selector(msgName)' vs. '@selector (msgName)'.
780 | # Also applies to '@protocol()' constructs.
781 | sp_after_oc_at_sel = ignore # ignore/add/remove/force
782 |
783 | # (OC) Add or remove space between '@selector(x)' and the following word,
784 | # i.e. '@selector(foo) a:' vs. '@selector(foo)a:'.
785 | sp_after_oc_at_sel_parens = ignore # ignore/add/remove/force
786 |
787 | # (OC) Add or remove space inside '@selector' parentheses,
788 | # i.e. '@selector(foo)' vs. '@selector( foo )'.
789 | # Also applies to '@protocol()' constructs.
790 | sp_inside_oc_at_sel_parens = ignore # ignore/add/remove/force
791 |
792 | # (OC) Add or remove space before a block pointer caret,
793 | # i.e. '^int (int arg){...}' vs. ' ^int (int arg){...}'.
794 | sp_before_oc_block_caret = ignore # ignore/add/remove/force
795 |
796 | # (OC) Add or remove space after a block pointer caret,
797 | # i.e. '^int (int arg){...}' vs. '^ int (int arg){...}'.
798 | sp_after_oc_block_caret = ignore # ignore/add/remove/force
799 |
800 | # (OC) Add or remove space between the receiver and selector in a message,
801 | # as in '[receiver selector ...]'.
802 | sp_after_oc_msg_receiver = ignore # ignore/add/remove/force
803 |
804 | # (OC) Add or remove space after '@property'.
805 | sp_after_oc_property = ignore # ignore/add/remove/force
806 |
807 | # (OC) Add or remove space between '@synchronized' and the open parenthesis,
808 | # i.e. '@synchronized(foo)' vs. '@synchronized (foo)'.
809 | sp_after_oc_synchronized = ignore # ignore/add/remove/force
810 |
811 | # Add or remove space around the ':' in 'b ? t : f'.
812 | sp_cond_colon = ignore # ignore/add/remove/force
813 |
814 | # Add or remove space before the ':' in 'b ? t : f'.
815 | #
816 | # Overrides sp_cond_colon.
817 | sp_cond_colon_before = ignore # ignore/add/remove/force
818 |
819 | # Add or remove space after the ':' in 'b ? t : f'.
820 | #
821 | # Overrides sp_cond_colon.
822 | sp_cond_colon_after = ignore # ignore/add/remove/force
823 |
824 | # Add or remove space around the '?' in 'b ? t : f'.
825 | sp_cond_question = ignore # ignore/add/remove/force
826 |
827 | # Add or remove space before the '?' in 'b ? t : f'.
828 | #
829 | # Overrides sp_cond_question.
830 | sp_cond_question_before = ignore # ignore/add/remove/force
831 |
832 | # Add or remove space after the '?' in 'b ? t : f'.
833 | #
834 | # Overrides sp_cond_question.
835 | sp_cond_question_after = ignore # ignore/add/remove/force
836 |
837 | # In the abbreviated ternary form '(a ?: b)', add or remove space between '?'
838 | # and ':'.
839 | #
840 | # Overrides all other sp_cond_* options.
841 | sp_cond_ternary_short = ignore # ignore/add/remove/force
842 |
843 | # Fix the spacing between 'case' and the label. Only 'ignore' and 'force' make
844 | # sense here.
845 | sp_case_label = ignore # ignore/add/remove/force
846 |
847 | # (D) Add or remove space around the D '..' operator.
848 | sp_range = ignore # ignore/add/remove/force
849 |
850 | # Add or remove space after ':' in a Java/C++11 range-based 'for',
851 | # as in 'for (Type var : expr)'.
852 | sp_after_for_colon = ignore # ignore/add/remove/force
853 |
854 | # Add or remove space before ':' in a Java/C++11 range-based 'for',
855 | # as in 'for (Type var : expr)'.
856 | sp_before_for_colon = ignore # ignore/add/remove/force
857 |
858 | # (D) Add or remove space between 'extern' and '(' as in 'extern (C)'.
859 | sp_extern_paren = ignore # ignore/add/remove/force
860 |
861 | # Add or remove space after the opening of a C++ comment,
862 | # i.e. '// A' vs. '//A'.
863 | sp_cmt_cpp_start = ignore # ignore/add/remove/force
864 |
865 | # If true, space is added with sp_cmt_cpp_start will be added after doxygen
866 | # sequences like '///', '///<', '//!' and '//!<'.
867 | sp_cmt_cpp_doxygen = false # true/false
868 |
869 | # If true, space is added with sp_cmt_cpp_start will be added after Qt
870 | # translator or meta-data comments like '//:', '//=', and '//~'.
871 | sp_cmt_cpp_qttr = false # true/false
872 |
873 | # Add or remove space between #else or #endif and a trailing comment.
874 | sp_endif_cmt = ignore # ignore/add/remove/force
875 |
876 | # Add or remove space after 'new', 'delete' and 'delete[]'.
877 | sp_after_new = ignore # ignore/add/remove/force
878 |
879 | # Add or remove space between 'new' and '(' in 'new()'.
880 | sp_between_new_paren = ignore # ignore/add/remove/force
881 |
882 | # Add or remove space between ')' and type in 'new(foo) BAR'.
883 | sp_after_newop_paren = ignore # ignore/add/remove/force
884 |
885 | # Add or remove space inside parenthesis of the new operator
886 | # as in 'new(foo) BAR'.
887 | sp_inside_newop_paren = ignore # ignore/add/remove/force
888 |
889 | # Add or remove space after the open parenthesis of the new operator,
890 | # as in 'new(foo) BAR'.
891 | #
892 | # Overrides sp_inside_newop_paren.
893 | sp_inside_newop_paren_open = ignore # ignore/add/remove/force
894 |
895 | # Add or remove space before the close parenthesis of the new operator,
896 | # as in 'new(foo) BAR'.
897 | #
898 | # Overrides sp_inside_newop_paren.
899 | sp_inside_newop_paren_close = ignore # ignore/add/remove/force
900 |
901 | # Add or remove space before a trailing or embedded comment.
902 | sp_before_tr_emb_cmt = ignore # ignore/add/remove/force
903 |
904 | # Number of spaces before a trailing or embedded comment.
905 | sp_num_before_tr_emb_cmt = 0 # unsigned number
906 |
907 | # (Java) Add or remove space between an annotation and the open parenthesis.
908 | sp_annotation_paren = ignore # ignore/add/remove/force
909 |
910 | # If true, vbrace tokens are dropped to the previous token and skipped.
911 | sp_skip_vbrace_tokens = false # true/false
912 |
913 | # Add or remove space after 'noexcept'.
914 | sp_after_noexcept = ignore # ignore/add/remove/force
915 |
916 | # Add or remove space after '_'.
917 | sp_vala_after_translation = ignore # ignore/add/remove/force
918 |
919 | # If true, a is inserted after #define.
920 | force_tab_after_define = false # true/false
921 |
922 | #
923 | # Indenting options
924 | #
925 |
926 | # The number of columns to indent per level. Usually 2, 3, 4, or 8.
927 | #
928 | # Default: 8
929 | indent_columns = 8 # unsigned number
930 |
931 | # The continuation indent. If non-zero, this overrides the indent of '(', '['
932 | # and '=' continuation indents. Negative values are OK; negative value is
933 | # absolute and not increased for each '(' or '[' level.
934 | #
935 | # For FreeBSD, this is set to 4.
936 | indent_continue = 0 # number
937 |
938 | # The continuation indent, only for class header line(s). If non-zero, this
939 | # overrides the indent of 'class' continuation indents.
940 | indent_continue_class_head = 0 # unsigned number
941 |
942 | # Whether to indent empty lines (i.e. lines which contain only spaces before
943 | # the newline character).
944 | indent_single_newlines = false # true/false
945 |
946 | # The continuation indent for func_*_param if they are true. If non-zero, this
947 | # overrides the indent.
948 | indent_param = 0 # unsigned number
949 |
950 | # How to use tabs when indenting code.
951 | #
952 | # 0: Spaces only
953 | # 1: Indent with tabs to brace level, align with spaces (default)
954 | # 2: Indent and align with tabs, using spaces when not on a tabstop
955 | #
956 | # Default: 1
957 | indent_with_tabs = 1 # unsigned number
958 |
959 | # Whether to indent comments that are not at a brace level with tabs on a
960 | # tabstop. Requires indent_with_tabs=2. If false, will use spaces.
961 | indent_cmt_with_tabs = false # true/false
962 |
963 | # Whether to indent strings broken by '\' so that they line up.
964 | indent_align_string = false # true/false
965 |
966 | # The number of spaces to indent multi-line XML strings.
967 | # Requires indent_align_string=true.
968 | indent_xml_string = 0 # unsigned number
969 |
970 | # Spaces to indent '{' from level.
971 | indent_brace = 0 # unsigned number
972 |
973 | # Whether braces are indented to the body level.
974 | indent_braces = false # true/false
975 |
976 | # Whether to disable indenting function braces if indent_braces=true.
977 | indent_braces_no_func = false # true/false
978 |
979 | # Whether to disable indenting class braces if indent_braces=true.
980 | indent_braces_no_class = false # true/false
981 |
982 | # Whether to disable indenting struct braces if indent_braces=true.
983 | indent_braces_no_struct = false # true/false
984 |
985 | # Whether to indent based on the size of the brace parent,
986 | # i.e. 'if' => 3 spaces, 'for' => 4 spaces, etc.
987 | indent_brace_parent = false # true/false
988 |
989 | # Whether to indent based on the open parenthesis instead of the open brace
990 | # in '({\n'.
991 | indent_paren_open_brace = false # true/false
992 |
993 | # (C#) Whether to indent the brace of a C# delegate by another level.
994 | indent_cs_delegate_brace = false # true/false
995 |
996 | # (C#) Whether to indent a C# delegate (to handle delegates with no brace) by
997 | # another level.
998 | indent_cs_delegate_body = false # true/false
999 |
1000 | # Whether to indent the body of a 'namespace'.
1001 | indent_namespace = false # true/false
1002 |
1003 | # Whether to indent only the first namespace, and not any nested namespaces.
1004 | # Requires indent_namespace=true.
1005 | indent_namespace_single_indent = false # true/false
1006 |
1007 | # The number of spaces to indent a namespace block.
1008 | # If set to zero, use the value indent_columns
1009 | indent_namespace_level = 0 # unsigned number
1010 |
1011 | # If the body of the namespace is longer than this number, it won't be
1012 | # indented. Requires indent_namespace=true. 0 means no limit.
1013 | indent_namespace_limit = 0 # unsigned number
1014 |
1015 | # Whether the 'extern "C"' body is indented.
1016 | indent_extern = false # true/false
1017 |
1018 | # Whether the 'class' body is indented.
1019 | indent_class = true # true/false
1020 |
1021 | # Whether to indent the stuff after a leading base class colon.
1022 | indent_class_colon = false # true/false
1023 |
1024 | # Whether to indent based on a class colon instead of the stuff after the
1025 | # colon. Requires indent_class_colon=true.
1026 | indent_class_on_colon = false # true/false
1027 |
1028 | # Whether to indent the stuff after a leading class initializer colon.
1029 | indent_constr_colon = false # true/false
1030 |
1031 | # Virtual indent from the ':' for member initializers.
1032 | #
1033 | # Default: 2
1034 | indent_ctor_init_leading = 2 # unsigned number
1035 |
1036 | # Additional indent for constructor initializer list.
1037 | # Negative values decrease indent down to the first column.
1038 | indent_ctor_init = 0 # number
1039 |
1040 | # Whether to indent 'if' following 'else' as a new block under the 'else'.
1041 | # If false, 'else\nif' is treated as 'else if' for indenting purposes.
1042 | indent_else_if = false # true/false
1043 |
1044 | # Amount to indent variable declarations after a open brace.
1045 | #
1046 | # <0: Relative
1047 | # >=0: Absolute
1048 | indent_var_def_blk = 0 # number
1049 |
1050 | # Whether to indent continued variable declarations instead of aligning.
1051 | indent_var_def_cont = false # true/false
1052 |
1053 | # Whether to indent continued shift expressions ('<<' and '>>') instead of
1054 | # aligning. Set align_left_shift=false when enabling this.
1055 | indent_shift = false # true/false
1056 |
1057 | # Whether to force indentation of function definitions to start in column 1.
1058 | indent_func_def_force_col1 = false # true/false
1059 |
1060 | # Whether to indent continued function call parameters one indent level,
1061 | # rather than aligning parameters under the open parenthesis.
1062 | indent_func_call_param = false # true/false
1063 |
1064 | # Whether to indent continued function definition parameters one indent level,
1065 | # rather than aligning parameters under the open parenthesis.
1066 | indent_func_def_param = false # true/false
1067 |
1068 | # for function definitions, only if indent_func_def_param is false
1069 | # Allows to align params when appropriate and indent them when not
1070 | # behave as if it was true if paren position is more than this value
1071 | # if paren position is more than the option value
1072 | indent_func_def_param_paren_pos_threshold = 0 # unsigned number
1073 |
1074 | # Whether to indent continued function call prototype one indent level,
1075 | # rather than aligning parameters under the open parenthesis.
1076 | indent_func_proto_param = false # true/false
1077 |
1078 | # Whether to indent continued function call declaration one indent level,
1079 | # rather than aligning parameters under the open parenthesis.
1080 | indent_func_class_param = false # true/false
1081 |
1082 | # Whether to indent continued class variable constructors one indent level,
1083 | # rather than aligning parameters under the open parenthesis.
1084 | indent_func_ctor_var_param = false # true/false
1085 |
1086 | # Whether to indent continued template parameter list one indent level,
1087 | # rather than aligning parameters under the open parenthesis.
1088 | indent_template_param = false # true/false
1089 |
1090 | # Double the indent for indent_func_xxx_param options.
1091 | # Use both values of the options indent_columns and indent_param.
1092 | indent_func_param_double = false # true/false
1093 |
1094 | # Indentation column for standalone 'const' qualifier on a function
1095 | # prototype.
1096 | indent_func_const = 0 # unsigned number
1097 |
1098 | # Indentation column for standalone 'throw' qualifier on a function
1099 | # prototype.
1100 | indent_func_throw = 0 # unsigned number
1101 |
1102 | # How to indent within a macro followed by a brace on the same line
1103 | # This allows reducing the indent in macros that have (for example)
1104 | # `do { ... } while (0)` blocks bracketing them.
1105 | #
1106 | # true: add an indent for the brace on the same line as the macro
1107 | # false: do not add an indent for the brace on the same line as the macro
1108 | #
1109 | # Default: true
1110 | indent_macro_brace = true # true/false
1111 |
1112 | # The number of spaces to indent a continued '->' or '.'.
1113 | # Usually set to 0, 1, or indent_columns.
1114 | indent_member = 0 # unsigned number
1115 |
1116 | # Whether lines broken at '.' or '->' should be indented by a single indent.
1117 | # The indent_member option will not be effective if this is set to true.
1118 | indent_member_single = false # true/false
1119 |
1120 | # Spaces to indent single line ('//') comments on lines before code.
1121 | indent_sing_line_comments = 0 # unsigned number
1122 |
1123 | # When opening a paren for a control statement (if, for, while, etc), increase
1124 | # the indent level by this value. Negative values decrease the indent level.
1125 | indent_sparen_extra = 0 # number
1126 |
1127 | # Whether to indent trailing single line ('//') comments relative to the code
1128 | # instead of trying to keep the same absolute column.
1129 | indent_relative_single_line_comments = false # true/false
1130 |
1131 | # Spaces to indent 'case' from 'switch'. Usually 0 or indent_columns.
1132 | indent_switch_case = 0 # unsigned number
1133 |
1134 | # indent 'break' with 'case' from 'switch'.
1135 | indent_switch_break_with_case = false # true/false
1136 |
1137 | # Whether to indent preprocessor statements inside of switch statements.
1138 | #
1139 | # Default: true
1140 | indent_switch_pp = true # true/false
1141 |
1142 | # Spaces to shift the 'case' line, without affecting any other lines.
1143 | # Usually 0.
1144 | indent_case_shift = 0 # unsigned number
1145 |
1146 | # Spaces to indent '{' from 'case'. By default, the brace will appear under
1147 | # the 'c' in case. Usually set to 0 or indent_columns. Negative values are OK.
1148 | indent_case_brace = 0 # number
1149 |
1150 | # Whether to indent comments found in first column.
1151 | indent_col1_comment = false # true/false
1152 |
1153 | # Whether to indent multi string literal in first column.
1154 | indent_col1_multi_string_literal = false # true/false
1155 |
1156 | # How to indent goto labels.
1157 | #
1158 | # >0: Absolute column where 1 is the leftmost column
1159 | # <=0: Subtract from brace indent
1160 | #
1161 | # Default: 1
1162 | indent_label = 1 # number
1163 |
1164 | # How to indent access specifiers that are followed by a
1165 | # colon.
1166 | #
1167 | # >0: Absolute column where 1 is the leftmost column
1168 | # <=0: Subtract from brace indent
1169 | #
1170 | # Default: 1
1171 | indent_access_spec = 1 # number
1172 |
1173 | # Whether to indent the code after an access specifier by one level.
1174 | # If true, this option forces 'indent_access_spec=0'.
1175 | indent_access_spec_body = false # true/false
1176 |
1177 | # If an open parenthesis is followed by a newline, whether to indent the next
1178 | # line so that it lines up after the open parenthesis (not recommended).
1179 | indent_paren_nl = false # true/false
1180 |
1181 | # How to indent a close parenthesis after a newline.
1182 | #
1183 | # 0: Indent to body level (default)
1184 | # 1: Align under the open parenthesis
1185 | # 2: Indent to the brace level
1186 | indent_paren_close = 0 # unsigned number
1187 |
1188 | # Whether to indent the open parenthesis of a function definition,
1189 | # if the parenthesis is on its own line.
1190 | indent_paren_after_func_def = false # true/false
1191 |
1192 | # Whether to indent the open parenthesis of a function declaration,
1193 | # if the parenthesis is on its own line.
1194 | indent_paren_after_func_decl = false # true/false
1195 |
1196 | # Whether to indent the open parenthesis of a function call,
1197 | # if the parenthesis is on its own line.
1198 | indent_paren_after_func_call = false # true/false
1199 |
1200 | # Whether to indent a comma when inside a parenthesis.
1201 | # If true, aligns under the open parenthesis.
1202 | indent_comma_paren = false # true/false
1203 |
1204 | # Whether to indent a Boolean operator when inside a parenthesis.
1205 | # If true, aligns under the open parenthesis.
1206 | indent_bool_paren = false # true/false
1207 |
1208 | # Whether to indent a semicolon when inside a for parenthesis.
1209 | # If true, aligns under the open for parenthesis.
1210 | indent_semicolon_for_paren = false # true/false
1211 |
1212 | # Whether to align the first expression to following ones
1213 | # if indent_bool_paren=true.
1214 | indent_first_bool_expr = false # true/false
1215 |
1216 | # Whether to align the first expression to following ones
1217 | # if indent_semicolon_for_paren=true.
1218 | indent_first_for_expr = false # true/false
1219 |
1220 | # If an open square is followed by a newline, whether to indent the next line
1221 | # so that it lines up after the open square (not recommended).
1222 | indent_square_nl = false # true/false
1223 |
1224 | # (ESQL/C) Whether to preserve the relative indent of 'EXEC SQL' bodies.
1225 | indent_preserve_sql = false # true/false
1226 |
1227 | # Whether to align continued statements at the '='. If false or if the '=' is
1228 | # followed by a newline, the next line is indent one tab.
1229 | #
1230 | # Default: true
1231 | indent_align_assign = true # true/false
1232 |
1233 | # If true, the indentation of the chunks after a '=' sequence will be set at
1234 | # LHS token indentation column before '='.
1235 | indent_off_after_assign = false # true/false
1236 |
1237 | # Whether to align continued statements at the '('. If false or the '(' is
1238 | # followed by a newline, the next line indent is one tab.
1239 | #
1240 | # Default: true
1241 | indent_align_paren = true # true/false
1242 |
1243 | # (OC) Whether to indent Objective-C code inside message selectors.
1244 | indent_oc_inside_msg_sel = false # true/false
1245 |
1246 | # (OC) Whether to indent Objective-C blocks at brace level instead of usual
1247 | # rules.
1248 | indent_oc_block = false # true/false
1249 |
1250 | # (OC) Indent for Objective-C blocks in a message relative to the parameter
1251 | # name.
1252 | #
1253 | # =0: Use indent_oc_block rules
1254 | # >0: Use specified number of spaces to indent
1255 | indent_oc_block_msg = 0 # unsigned number
1256 |
1257 | # (OC) Minimum indent for subsequent parameters
1258 | indent_oc_msg_colon = 0 # unsigned number
1259 |
1260 | # (OC) Whether to prioritize aligning with initial colon (and stripping spaces
1261 | # from lines, if necessary).
1262 | #
1263 | # Default: true
1264 | indent_oc_msg_prioritize_first_colon = true # true/false
1265 |
1266 | # (OC) Whether to indent blocks the way that Xcode does by default
1267 | # (from the keyword if the parameter is on its own line; otherwise, from the
1268 | # previous indentation level). Requires indent_oc_block_msg=true.
1269 | indent_oc_block_msg_xcode_style = false # true/false
1270 |
1271 | # (OC) Whether to indent blocks from where the brace is, relative to a
1272 | # message keyword. Requires indent_oc_block_msg=true.
1273 | indent_oc_block_msg_from_keyword = false # true/false
1274 |
1275 | # (OC) Whether to indent blocks from where the brace is, relative to a message
1276 | # colon. Requires indent_oc_block_msg=true.
1277 | indent_oc_block_msg_from_colon = false # true/false
1278 |
1279 | # (OC) Whether to indent blocks from where the block caret is.
1280 | # Requires indent_oc_block_msg=true.
1281 | indent_oc_block_msg_from_caret = false # true/false
1282 |
1283 | # (OC) Whether to indent blocks from where the brace caret is.
1284 | # Requires indent_oc_block_msg=true.
1285 | indent_oc_block_msg_from_brace = false # true/false
1286 |
1287 | # When indenting after virtual brace open and newline add further spaces to
1288 | # reach this minimum indent.
1289 | indent_min_vbrace_open = 0 # unsigned number
1290 |
1291 | # Whether to add further spaces after regular indent to reach next tabstop
1292 | # when identing after virtual brace open and newline.
1293 | indent_vbrace_open_on_tabstop = false # true/false
1294 |
1295 | # How to indent after a brace followed by another token (not a newline).
1296 | # true: indent all contained lines to match the token
1297 | # false: indent all contained lines to match the brace
1298 | #
1299 | # Default: true
1300 | indent_token_after_brace = true # true/false
1301 |
1302 | # Whether to indent the body of a C++11 lambda.
1303 | indent_cpp_lambda_body = false # true/false
1304 |
1305 | # How to indent compound literals that are being returned.
1306 | # true: add both the indent from return & the compound literal open brace (ie:
1307 | # 2 indent levels)
1308 | # false: only indent 1 level, don't add the indent for the open brace, only add
1309 | # the indent for the return.
1310 | #
1311 | # Default: true
1312 | indent_compound_literal_return = true # true/false
1313 |
1314 | # (C#) Whether to indent a 'using' block if no braces are used.
1315 | #
1316 | # Default: true
1317 | indent_using_block = true # true/false
1318 |
1319 | # How to indent the continuation of ternary operator.
1320 | #
1321 | # 0: Off (default)
1322 | # 1: When the `if_false` is a continuation, indent it under `if_false`
1323 | # 2: When the `:` is a continuation, indent it under `?`
1324 | indent_ternary_operator = 0 # unsigned number
1325 |
1326 | # Whether to indent the statments inside ternary operator.
1327 | indent_inside_ternary_operator = false # true/false
1328 |
1329 | # If true, the indentation of the chunks after a `return` sequence will be set at return indentation column.
1330 | indent_off_after_return = false # true/false
1331 |
1332 | # If true, the indentation of the chunks after a `return new` sequence will be set at return indentation column.
1333 | indent_off_after_return_new = false # true/false
1334 |
1335 | # If true, the tokens after return are indented with regular single indentation. By default (false) the indentation is after the return token.
1336 | indent_single_after_return = false # true/false
1337 |
1338 | # Whether to ignore indent and alignment for 'asm' blocks (i.e. assume they
1339 | # have their own indentation).
1340 | indent_ignore_asm_block = false # true/false
1341 |
1342 | #
1343 | # Newline adding and removing options
1344 | #
1345 |
1346 | # Whether to collapse empty blocks between '{' and '}'.
1347 | nl_collapse_empty_body = false # true/false
1348 |
1349 | # Don't split one-line braced assignments, as in 'foo_t f = { 1, 2 };'.
1350 | nl_assign_leave_one_liners = true # true/false
1351 |
1352 | # Don't split one-line braced statements inside a 'class xx { }' body.
1353 | nl_class_leave_one_liners = false # true/false
1354 |
1355 | # Don't split one-line enums, as in 'enum foo { BAR = 15 };'
1356 | nl_enum_leave_one_liners = false # true/false
1357 |
1358 | # Don't split one-line get or set functions.
1359 | nl_getset_leave_one_liners = false # true/false
1360 |
1361 | # (C#) Don't split one-line property get or set functions.
1362 | nl_cs_property_leave_one_liners = false # true/false
1363 |
1364 | # Don't split one-line function definitions, as in 'int foo() { return 0; }'.
1365 | # might modify nl_func_type_name
1366 | nl_func_leave_one_liners = false # true/false
1367 |
1368 | # Don't split one-line C++11 lambdas, as in '[]() { return 0; }'.
1369 | nl_cpp_lambda_leave_one_liners = false # true/false
1370 |
1371 | # Don't split one-line if/else statements, as in 'if(...) b++;'.
1372 | nl_if_leave_one_liners = false # true/false
1373 |
1374 | # Don't split one-line while statements, as in 'while(...) b++;'.
1375 | nl_while_leave_one_liners = false # true/false
1376 |
1377 | # Don't split one-line for statements, as in 'for(...) b++;'.
1378 | nl_for_leave_one_liners = false # true/false
1379 |
1380 | # (OC) Don't split one-line Objective-C messages.
1381 | nl_oc_msg_leave_one_liner = false # true/false
1382 |
1383 | # (OC) Add or remove newline between method declaration and '{'.
1384 | nl_oc_mdef_brace = add # ignore/add/remove/force
1385 |
1386 | # (OC) Add or remove newline between Objective-C block signature and '{'.
1387 | nl_oc_block_brace = add # ignore/add/remove/force
1388 |
1389 | # (OC) Add or remove blank line before '@interface' statement.
1390 | nl_oc_before_interface = add # ignore/add/remove/force
1391 |
1392 | # (OC) Add or remove blank line before '@implementation' statement.
1393 | nl_oc_before_implementation = add # ignore/add/remove/force
1394 |
1395 | # (OC) Add or remove blank line before '@end' statement.
1396 | nl_oc_before_end = add # ignore/add/remove/force
1397 |
1398 | # (OC) Add or remove newline between '@interface' and '{'.
1399 | nl_oc_interface_brace = add # ignore/add/remove/force
1400 |
1401 | # (OC) Add or remove newline between '@implementation' and '{'.
1402 | nl_oc_implementation_brace = add # ignore/add/remove/force
1403 |
1404 | # Add or remove newlines at the start of the file.
1405 | nl_start_of_file = ignore # ignore/add/remove/force
1406 |
1407 | # The minimum number of newlines at the start of the file (only used if
1408 | # nl_start_of_file is 'add' or 'force').
1409 | nl_start_of_file_min = 0 # unsigned number
1410 |
1411 | # Add or remove newline at the end of the file.
1412 | nl_end_of_file = ignore # ignore/add/remove/force
1413 |
1414 | # The minimum number of newlines at the end of the file (only used if
1415 | # nl_end_of_file is 'add' or 'force').
1416 | nl_end_of_file_min = 0 # unsigned number
1417 |
1418 | # Add or remove newline between '=' and '{'.
1419 | nl_assign_brace = ignore # ignore/add/remove/force
1420 |
1421 | # (D) Add or remove newline between '=' and '['.
1422 | nl_assign_square = ignore # ignore/add/remove/force
1423 |
1424 | # Add or remove newline between '[]' and '{'.
1425 | nl_tsquare_brace = ignore # ignore/add/remove/force
1426 |
1427 | # (D) Add or remove newline after '= ['. Will also affect the newline before
1428 | # the ']'.
1429 | nl_after_square_assign = ignore # ignore/add/remove/force
1430 |
1431 | # Add or remove newline between a function call's ')' and '{', as in
1432 | # 'list_for_each(item, &list) { }'.
1433 | nl_fcall_brace = ignore # ignore/add/remove/force
1434 |
1435 | # Add or remove newline between 'enum' and '{'.
1436 | nl_enum_brace = ignore # ignore/add/remove/force
1437 |
1438 | # Add or remove newline between 'enum' and 'class'.
1439 | nl_enum_class = ignore # ignore/add/remove/force
1440 |
1441 | # Add or remove newline between 'enum class' and the identifier.
1442 | nl_enum_class_identifier = ignore # ignore/add/remove/force
1443 |
1444 | # Add or remove newline between 'enum class' type and ':'.
1445 | nl_enum_identifier_colon = ignore # ignore/add/remove/force
1446 |
1447 | # Add or remove newline between 'enum class identifier :' and type.
1448 | nl_enum_colon_type = ignore # ignore/add/remove/force
1449 |
1450 | # Add or remove newline between 'struct and '{'.
1451 | nl_struct_brace = add # ignore/add/remove/force
1452 |
1453 | # Add or remove newline between 'union' and '{'.
1454 | nl_union_brace = add # ignore/add/remove/force
1455 |
1456 | # Add or remove newline between 'if' and '{'.
1457 | nl_if_brace = add # ignore/add/remove/force
1458 |
1459 | # Add or remove newline between '}' and 'else'.
1460 | nl_brace_else = add # ignore/add/remove/force
1461 |
1462 | # Add or remove newline between 'else if' and '{'. If set to ignore,
1463 | # nl_if_brace is used instead.
1464 | nl_elseif_brace = add # ignore/add/remove/force
1465 |
1466 | # Add or remove newline between 'else' and '{'.
1467 | nl_else_brace = add # ignore/add/remove/force
1468 |
1469 | # Add or remove newline between 'else' and 'if'.
1470 | nl_else_if = add # ignore/add/remove/force
1471 |
1472 | # Add or remove newline before '{' opening brace
1473 | nl_before_opening_brace_func_class_def = add # ignore/add/remove/force
1474 |
1475 | # Add or remove newline before 'if'/'else if' closing parenthesis.
1476 | nl_before_if_closing_paren = ignore # ignore/add/remove/force
1477 |
1478 | # Add or remove newline between '}' and 'finally'.
1479 | nl_brace_finally = add # ignore/add/remove/force
1480 |
1481 | # Add or remove newline between 'finally' and '{'.
1482 | nl_finally_brace = add # ignore/add/remove/force
1483 |
1484 | # Add or remove newline between 'try' and '{'.
1485 | nl_try_brace = add # ignore/add/remove/force
1486 |
1487 | # Add or remove newline between get/set and '{'.
1488 | nl_getset_brace = add # ignore/add/remove/force
1489 |
1490 | # Add or remove newline between 'for' and '{'.
1491 | nl_for_brace = add # ignore/add/remove/force
1492 |
1493 | # Add or remove newline before the '{' of a 'catch' statement, as in
1494 | # 'catch (decl) {'.
1495 | nl_catch_brace = add # ignore/add/remove/force
1496 |
1497 | # (OC) Add or remove newline before the '{' of a '@catch' statement, as in
1498 | # '@catch (decl) {'. If set to ignore, nl_catch_brace is used.
1499 | nl_oc_catch_brace = add # ignore/add/remove/force
1500 |
1501 | # Add or remove newline between '}' and 'catch'.
1502 | nl_brace_catch = add # ignore/add/remove/force
1503 |
1504 | # (OC) Add or remove newline between '}' and '@catch'. If set to ignore,
1505 | # nl_brace_catch is used.
1506 | nl_oc_brace_catch = add # ignore/add/remove/force
1507 |
1508 | # Add or remove newline between '}' and ']'.
1509 | nl_brace_square = ignore # ignore/add/remove/force
1510 |
1511 | # Add or remove newline between '}' and ')' in a function invocation.
1512 | nl_brace_fparen = ignore # ignore/add/remove/force
1513 |
1514 | # Add or remove newline between 'while' and '{'.
1515 | nl_while_brace = add # ignore/add/remove/force
1516 |
1517 | # (D) Add or remove newline between 'scope (x)' and '{'.
1518 | nl_scope_brace = add # ignore/add/remove/force
1519 |
1520 | # (D) Add or remove newline between 'unittest' and '{'.
1521 | nl_unittest_brace = add # ignore/add/remove/force
1522 |
1523 | # (D) Add or remove newline between 'version (x)' and '{'.
1524 | nl_version_brace = add # ignore/add/remove/force
1525 |
1526 | # (C#) Add or remove newline between 'using' and '{'.
1527 | nl_using_brace = add # ignore/add/remove/force
1528 |
1529 | # Add or remove newline between two open or close braces. Due to general
1530 | # newline/brace handling, REMOVE may not work.
1531 | nl_brace_brace = ignore # ignore/add/remove/force
1532 |
1533 | # Add or remove newline between 'do' and '{'.
1534 | nl_do_brace = add # ignore/add/remove/force
1535 |
1536 | # Add or remove newline between '}' and 'while' of 'do' statement.
1537 | nl_brace_while = add # ignore/add/remove/force
1538 |
1539 | # Add or remove newline between 'switch' and '{'.
1540 | nl_switch_brace = add # ignore/add/remove/force
1541 |
1542 | # Add or remove newline between 'synchronized' and '{'.
1543 | nl_synchronized_brace = add # ignore/add/remove/force
1544 |
1545 | # Add a newline between ')' and '{' if the ')' is on a different line than the
1546 | # if/for/etc.
1547 | #
1548 | # Overrides nl_for_brace, nl_if_brace, nl_switch_brace, nl_while_switch and
1549 | # nl_catch_brace.
1550 | nl_multi_line_cond = false # true/false
1551 |
1552 | # Add a newline after '(' if an if/for/while/switch condition spans multiple
1553 | # lines
1554 | nl_multi_line_sparen_open = ignore # ignore/add/remove/force
1555 |
1556 | # Add a newline before ')' if an if/for/while/switch condition spans multiple
1557 | # lines. Overrides nl_before_if_closing_paren if both are specified.
1558 | nl_multi_line_sparen_close = ignore # ignore/add/remove/force
1559 |
1560 | # Force a newline in a define after the macro name for multi-line defines.
1561 | nl_multi_line_define = false # true/false
1562 |
1563 | # Whether to add a newline before 'case', and a blank line before a 'case'
1564 | # statement that follows a ';' or '}'.
1565 | nl_before_case = false # true/false
1566 |
1567 | # Whether to add a newline after a 'case' statement.
1568 | nl_after_case = true # true/false
1569 |
1570 | # Add or remove newline between a case ':' and '{'.
1571 | #
1572 | # Overrides nl_after_case.
1573 | nl_case_colon_brace = ignore # ignore/add/remove/force
1574 |
1575 | # Add or remove newline between ')' and 'throw'.
1576 | nl_before_throw = ignore # ignore/add/remove/force
1577 |
1578 | # Add or remove newline between 'namespace' and '{'.
1579 | nl_namespace_brace = ignore # ignore/add/remove/force
1580 |
1581 | # Add or remove newline after 'template<...>' of a template class.
1582 | nl_template_class = ignore # ignore/add/remove/force
1583 |
1584 | # Add or remove newline after 'template<...>' of a template class declaration.
1585 | #
1586 | # Overrides nl_template_class.
1587 | nl_template_class_decl = ignore # ignore/add/remove/force
1588 |
1589 | # Add or remove newline after 'template<>' of a specialized class declaration.
1590 | #
1591 | # Overrides nl_template_class_decl.
1592 | nl_template_class_decl_special = ignore # ignore/add/remove/force
1593 |
1594 | # Add or remove newline after 'template<...>' of a template class definition.
1595 | #
1596 | # Overrides nl_template_class.
1597 | nl_template_class_def = ignore # ignore/add/remove/force
1598 |
1599 | # Add or remove newline after 'template<>' of a specialized class definition.
1600 | #
1601 | # Overrides nl_template_class_def.
1602 | nl_template_class_def_special = ignore # ignore/add/remove/force
1603 |
1604 | # Add or remove newline after 'template<...>' of a template function.
1605 | nl_template_func = ignore # ignore/add/remove/force
1606 |
1607 | # Add or remove newline after 'template<...>' of a template function
1608 | # declaration.
1609 | #
1610 | # Overrides nl_template_func.
1611 | nl_template_func_decl = ignore # ignore/add/remove/force
1612 |
1613 | # Add or remove newline after 'template<>' of a specialized function
1614 | # declaration.
1615 | #
1616 | # Overrides nl_template_func_decl.
1617 | nl_template_func_decl_special = ignore # ignore/add/remove/force
1618 |
1619 | # Add or remove newline after 'template<...>' of a template function
1620 | # definition.
1621 | #
1622 | # Overrides nl_template_func.
1623 | nl_template_func_def = ignore # ignore/add/remove/force
1624 |
1625 | # Add or remove newline after 'template<>' of a specialized function
1626 | # definition.
1627 | #
1628 | # Overrides nl_template_func_def.
1629 | nl_template_func_def_special = ignore # ignore/add/remove/force
1630 |
1631 | # Add or remove newline after 'template<...>' of a template variable.
1632 | nl_template_var = ignore # ignore/add/remove/force
1633 |
1634 | # Add or remove newline between 'template<...>' and 'using' of a templated
1635 | # type alias.
1636 | nl_template_using = ignore # ignore/add/remove/force
1637 |
1638 | # Add or remove newline between 'class' and '{'.
1639 | nl_class_brace = add # ignore/add/remove/force
1640 |
1641 | # Add or remove newline before or after (depending on pos_class_comma,
1642 | # may not be IGNORE) each',' in the base class list.
1643 | nl_class_init_args = ignore # ignore/add/remove/force
1644 |
1645 | # Add or remove newline after each ',' in the constructor member
1646 | # initialization. Related to nl_constr_colon, pos_constr_colon and
1647 | # pos_constr_comma.
1648 | nl_constr_init_args = ignore # ignore/add/remove/force
1649 |
1650 | # Add or remove newline before first element, after comma, and after last
1651 | # element, in 'enum'.
1652 | nl_enum_own_lines = ignore # ignore/add/remove/force
1653 |
1654 | # Add or remove newline between return type and function name in a function
1655 | # definition.
1656 | # might be modified by nl_func_leave_one_liners
1657 | nl_func_type_name = ignore # ignore/add/remove/force
1658 |
1659 | # Add or remove newline between return type and function name inside a class
1660 | # definition. If set to ignore, nl_func_type_name or nl_func_proto_type_name
1661 | # is used instead.
1662 | nl_func_type_name_class = ignore # ignore/add/remove/force
1663 |
1664 | # Add or remove newline between class specification and '::'
1665 | # in 'void A::f() { }'. Only appears in separate member implementation (does
1666 | # not appear with in-line implementation).
1667 | nl_func_class_scope = ignore # ignore/add/remove/force
1668 |
1669 | # Add or remove newline between function scope and name, as in
1670 | # 'void A :: f() { }'.
1671 | nl_func_scope_name = ignore # ignore/add/remove/force
1672 |
1673 | # Add or remove newline between return type and function name in a prototype.
1674 | nl_func_proto_type_name = ignore # ignore/add/remove/force
1675 |
1676 | # Add or remove newline between a function name and the opening '(' in the
1677 | # declaration.
1678 | nl_func_paren = ignore # ignore/add/remove/force
1679 |
1680 | # Overrides nl_func_paren for functions with no parameters.
1681 | nl_func_paren_empty = ignore # ignore/add/remove/force
1682 |
1683 | # Add or remove newline between a function name and the opening '(' in the
1684 | # definition.
1685 | nl_func_def_paren = ignore # ignore/add/remove/force
1686 |
1687 | # Overrides nl_func_def_paren for functions with no parameters.
1688 | nl_func_def_paren_empty = ignore # ignore/add/remove/force
1689 |
1690 | # Add or remove newline between a function name and the opening '(' in the
1691 | # call.
1692 | nl_func_call_paren = ignore # ignore/add/remove/force
1693 |
1694 | # Overrides nl_func_call_paren for functions with no parameters.
1695 | nl_func_call_paren_empty = ignore # ignore/add/remove/force
1696 |
1697 | # Add or remove newline after '(' in a function declaration.
1698 | nl_func_decl_start = ignore # ignore/add/remove/force
1699 |
1700 | # Add or remove newline after '(' in a function definition.
1701 | nl_func_def_start = ignore # ignore/add/remove/force
1702 |
1703 | # Overrides nl_func_decl_start when there is only one parameter.
1704 | nl_func_decl_start_single = ignore # ignore/add/remove/force
1705 |
1706 | # Overrides nl_func_def_start when there is only one parameter.
1707 | nl_func_def_start_single = ignore # ignore/add/remove/force
1708 |
1709 | # Whether to add a newline after '(' in a function declaration if '(' and ')'
1710 | # are in different lines. If false, nl_func_decl_start is used instead.
1711 | nl_func_decl_start_multi_line = false # true/false
1712 |
1713 | # Whether to add a newline after '(' in a function definition if '(' and ')'
1714 | # are in different lines. If false, nl_func_def_start is used instead.
1715 | nl_func_def_start_multi_line = false # true/false
1716 |
1717 | # Add or remove newline after each ',' in a function declaration.
1718 | nl_func_decl_args = ignore # ignore/add/remove/force
1719 |
1720 | # Add or remove newline after each ',' in a function definition.
1721 | nl_func_def_args = ignore # ignore/add/remove/force
1722 |
1723 | # Add or remove newline after each ',' in a function call.
1724 | nl_func_call_args = ignore # ignore/add/remove/force
1725 |
1726 | # Whether to add a newline after each ',' in a function declaration if '('
1727 | # and ')' are in different lines. If false, nl_func_decl_args is used instead.
1728 | nl_func_decl_args_multi_line = false # true/false
1729 |
1730 | # Whether to add a newline after each ',' in a function definition if '('
1731 | # and ')' are in different lines. If false, nl_func_def_args is used instead.
1732 | nl_func_def_args_multi_line = false # true/false
1733 |
1734 | # Add or remove newline before the ')' in a function declaration.
1735 | nl_func_decl_end = ignore # ignore/add/remove/force
1736 |
1737 | # Add or remove newline before the ')' in a function definition.
1738 | nl_func_def_end = ignore # ignore/add/remove/force
1739 |
1740 | # Overrides nl_func_decl_end when there is only one parameter.
1741 | nl_func_decl_end_single = ignore # ignore/add/remove/force
1742 |
1743 | # Overrides nl_func_def_end when there is only one parameter.
1744 | nl_func_def_end_single = ignore # ignore/add/remove/force
1745 |
1746 | # Whether to add a newline before ')' in a function declaration if '(' and ')'
1747 | # are in different lines. If false, nl_func_decl_end is used instead.
1748 | nl_func_decl_end_multi_line = false # true/false
1749 |
1750 | # Whether to add a newline before ')' in a function definition if '(' and ')'
1751 | # are in different lines. If false, nl_func_def_end is used instead.
1752 | nl_func_def_end_multi_line = false # true/false
1753 |
1754 | # Add or remove newline between '()' in a function declaration.
1755 | nl_func_decl_empty = ignore # ignore/add/remove/force
1756 |
1757 | # Add or remove newline between '()' in a function definition.
1758 | nl_func_def_empty = ignore # ignore/add/remove/force
1759 |
1760 | # Add or remove newline between '()' in a function call.
1761 | nl_func_call_empty = ignore # ignore/add/remove/force
1762 |
1763 | # Whether to add a newline after '(' in a function call,
1764 | # has preference over nl_func_call_start_multi_line.
1765 | nl_func_call_start = ignore # ignore/add/remove/force
1766 |
1767 | # Whether to add a newline before ')' in a function call.
1768 | nl_func_call_end = ignore # ignore/add/remove/force
1769 |
1770 | # Whether to add a newline after '(' in a function call if '(' and ')' are in
1771 | # different lines.
1772 | nl_func_call_start_multi_line = false # true/false
1773 |
1774 | # Whether to add a newline after each ',' in a function call if '(' and ')'
1775 | # are in different lines.
1776 | nl_func_call_args_multi_line = false # true/false
1777 |
1778 | # Whether to add a newline before ')' in a function call if '(' and ')' are in
1779 | # different lines.
1780 | nl_func_call_end_multi_line = false # true/false
1781 |
1782 | # Whether to respect nl_func_call_XXX option incase of closure args.
1783 | nl_func_call_args_multi_line_ignore_closures = false # true/false
1784 |
1785 | # Whether to add a newline after '<' of a template parameter list.
1786 | nl_template_start = false # true/false
1787 |
1788 | # Whether to add a newline after each ',' in a template parameter list.
1789 | nl_template_args = false # true/false
1790 |
1791 | # Whether to add a newline before '>' of a template parameter list.
1792 | nl_template_end = false # true/false
1793 |
1794 | # (OC) Whether to put each Objective-C message parameter on a separate line.
1795 | # See nl_oc_msg_leave_one_liner.
1796 | nl_oc_msg_args = false # true/false
1797 |
1798 | # Add or remove newline between function signature and '{'.
1799 | nl_fdef_brace = add # ignore/add/remove/force
1800 |
1801 | # Add or remove newline between function signature and '{',
1802 | # if signature ends with ')'. Overrides nl_fdef_brace.
1803 | nl_fdef_brace_cond = ignore # ignore/add/remove/force
1804 |
1805 | # Add or remove newline between C++11 lambda signature and '{'.
1806 | nl_cpp_ldef_brace = ignore # ignore/add/remove/force
1807 |
1808 | # Add or remove newline between 'return' and the return expression.
1809 | nl_return_expr = ignore # ignore/add/remove/force
1810 |
1811 | # Whether to add a newline after semicolons, except in 'for' statements.
1812 | nl_after_semicolon = false # true/false
1813 |
1814 | # (Java) Add or remove newline between the ')' and '{{' of the double brace
1815 | # initializer.
1816 | nl_paren_dbrace_open = ignore # ignore/add/remove/force
1817 |
1818 | # Whether to add a newline after the type in an unnamed temporary
1819 | # direct-list-initialization.
1820 | nl_type_brace_init_lst = ignore # ignore/add/remove/force
1821 |
1822 | # Whether to add a newline after the open brace in an unnamed temporary
1823 | # direct-list-initialization.
1824 | nl_type_brace_init_lst_open = ignore # ignore/add/remove/force
1825 |
1826 | # Whether to add a newline before the close brace in an unnamed temporary
1827 | # direct-list-initialization.
1828 | nl_type_brace_init_lst_close = ignore # ignore/add/remove/force
1829 |
1830 | # Whether to add a newline after '{'. This also adds a newline before the
1831 | # matching '}'.
1832 | nl_after_brace_open = false # true/false
1833 |
1834 | # Whether to add a newline between the open brace and a trailing single-line
1835 | # comment. Requires nl_after_brace_open=true.
1836 | nl_after_brace_open_cmt = false # true/false
1837 |
1838 | # Whether to add a newline after a virtual brace open with a non-empty body.
1839 | # These occur in un-braced if/while/do/for statement bodies.
1840 | nl_after_vbrace_open = false # true/false
1841 |
1842 | # Whether to add a newline after a virtual brace open with an empty body.
1843 | # These occur in un-braced if/while/do/for statement bodies.
1844 | nl_after_vbrace_open_empty = false # true/false
1845 |
1846 | # Whether to add a newline after '}'. Does not apply if followed by a
1847 | # necessary ';'.
1848 | nl_after_brace_close = false # true/false
1849 |
1850 | # Whether to add a newline after a virtual brace close,
1851 | # as in 'if (foo) a++; return;'.
1852 | nl_after_vbrace_close = false # true/false
1853 |
1854 | # Add or remove newline between the close brace and identifier,
1855 | # as in 'struct { int a; } b;'. Affects enumerations, unions and
1856 | # structures. If set to ignore, uses nl_after_brace_close.
1857 | nl_brace_struct_var = ignore # ignore/add/remove/force
1858 |
1859 | # Whether to alter newlines in '#define' macros.
1860 | nl_define_macro = false # true/false
1861 |
1862 | # Whether to alter newlines between consecutive parenthesis closes. The number
1863 | # of closing parentheses in a line will depend on respective open parenthesis
1864 | # lines.
1865 | nl_squeeze_paren_close = false # true/false
1866 |
1867 | # Whether to remove blanks after '#ifxx' and '#elxx', or before '#elxx' and
1868 | # '#endif'. Does not affect top-level #ifdefs.
1869 | nl_squeeze_ifdef = false # true/false
1870 |
1871 | # Makes the nl_squeeze_ifdef option affect the top-level #ifdefs as well.
1872 | nl_squeeze_ifdef_top_level = false # true/false
1873 |
1874 | # Add or remove blank line before 'if'.
1875 | nl_before_if = ignore # ignore/add/remove/force
1876 |
1877 | # Add or remove blank line after 'if' statement. Add/Force work only if the
1878 | # next token is not a closing brace.
1879 | nl_after_if = ignore # ignore/add/remove/force
1880 |
1881 | # Add or remove blank line before 'for'.
1882 | nl_before_for = ignore # ignore/add/remove/force
1883 |
1884 | # Add or remove blank line after 'for' statement.
1885 | nl_after_for = ignore # ignore/add/remove/force
1886 |
1887 | # Add or remove blank line before 'while'.
1888 | nl_before_while = ignore # ignore/add/remove/force
1889 |
1890 | # Add or remove blank line after 'while' statement.
1891 | nl_after_while = ignore # ignore/add/remove/force
1892 |
1893 | # Add or remove blank line before 'switch'.
1894 | nl_before_switch = ignore # ignore/add/remove/force
1895 |
1896 | # Add or remove blank line after 'switch' statement.
1897 | nl_after_switch = ignore # ignore/add/remove/force
1898 |
1899 | # Add or remove blank line before 'synchronized'.
1900 | nl_before_synchronized = ignore # ignore/add/remove/force
1901 |
1902 | # Add or remove blank line after 'synchronized' statement.
1903 | nl_after_synchronized = ignore # ignore/add/remove/force
1904 |
1905 | # Add or remove blank line before 'do'.
1906 | nl_before_do = ignore # ignore/add/remove/force
1907 |
1908 | # Add or remove blank line after 'do/while' statement.
1909 | nl_after_do = ignore # ignore/add/remove/force
1910 |
1911 | # Whether to put a blank line before 'return' statements, unless after an open
1912 | # brace.
1913 | nl_before_return = false # true/false
1914 |
1915 | # Whether to put a blank line after 'return' statements, unless followed by a
1916 | # close brace.
1917 | nl_after_return = false # true/false
1918 |
1919 | # Whether to put a blank line before a member '.' or '->' operators.
1920 | nl_before_member = ignore # ignore/add/remove/force
1921 |
1922 | # (Java) Whether to put a blank line after a member '.' or '->' operators.
1923 | nl_after_member = ignore # ignore/add/remove/force
1924 |
1925 | # Whether to double-space commented-entries in 'struct'/'union'/'enum'.
1926 | nl_ds_struct_enum_cmt = false # true/false
1927 |
1928 | # Whether to force a newline before '}' of a 'struct'/'union'/'enum'.
1929 | # (Lower priority than eat_blanks_before_close_brace.)
1930 | nl_ds_struct_enum_close_brace = false # true/false
1931 |
1932 | # Add or remove newline before or after (depending on pos_class_colon) a class
1933 | # colon, as in 'class Foo : public Bar'.
1934 | nl_class_colon = ignore # ignore/add/remove/force
1935 |
1936 | # Add or remove newline around a class constructor colon. The exact position
1937 | # depends on nl_constr_init_args, pos_constr_colon and pos_constr_comma.
1938 | nl_constr_colon = ignore # ignore/add/remove/force
1939 |
1940 | # Whether to collapse a two-line namespace, like 'namespace foo\n{ decl; }'
1941 | # into a single line. If true, prevents other brace newline rules from turning
1942 | # such code into four lines.
1943 | nl_namespace_two_to_one_liner = false # true/false
1944 |
1945 | # Whether to remove a newline in simple unbraced if statements, turning them
1946 | # into one-liners, as in 'if(b)\n i++;' => 'if(b) i++;'.
1947 | nl_create_if_one_liner = false # true/false
1948 |
1949 | # Whether to remove a newline in simple unbraced for statements, turning them
1950 | # into one-liners, as in 'for (...)\n stmt;' => 'for (...) stmt;'.
1951 | nl_create_for_one_liner = false # true/false
1952 |
1953 | # Whether to remove a newline in simple unbraced while statements, turning
1954 | # them into one-liners, as in 'while (expr)\n stmt;' => 'while (expr) stmt;'.
1955 | nl_create_while_one_liner = false # true/false
1956 |
1957 | # Whether to collapse a function definition whose body (not counting braces)
1958 | # is only one line so that the entire definition (prototype, braces, body) is
1959 | # a single line.
1960 | nl_create_func_def_one_liner = false # true/false
1961 |
1962 | # Whether to collapse a function definition whose body (not counting braces)
1963 | # is only one line so that the entire definition (prototype, braces, body) is
1964 | # a single line.
1965 | nl_create_list_one_liner = false # true/false
1966 |
1967 | # Whether to split one-line simple unbraced if statements into two lines by
1968 | # adding a newline, as in 'if(b) i++;'.
1969 | nl_split_if_one_liner = false # true/false
1970 |
1971 | # Whether to split one-line simple unbraced for statements into two lines by
1972 | # adding a newline, as in 'for (...) stmt;'.
1973 | nl_split_for_one_liner = false # true/false
1974 |
1975 | # Whether to split one-line simple unbraced while statements into two lines by
1976 | # adding a newline, as in 'while (expr) stmt;'.
1977 | nl_split_while_one_liner = false # true/false
1978 |
1979 | #
1980 | # Blank line options
1981 | #
1982 |
1983 | # The maximum number of consecutive newlines (3 = 2 blank lines).
1984 | nl_max = 0 # unsigned number
1985 |
1986 | # The maximum number of consecutive newlines in a function.
1987 | nl_max_blank_in_func = 0 # unsigned number
1988 |
1989 | # The number of newlines before a function prototype.
1990 | nl_before_func_body_proto = 0 # unsigned number
1991 |
1992 | # The number of newlines before a multi-line function definition.
1993 | nl_before_func_body_def = 0 # unsigned number
1994 |
1995 | # The number of newlines before a class constructor/destructor prototype.
1996 | nl_before_func_class_proto = 0 # unsigned number
1997 |
1998 | # The number of newlines before a class constructor/destructor definition.
1999 | nl_before_func_class_def = 0 # unsigned number
2000 |
2001 | # The number of newlines after a function prototype.
2002 | nl_after_func_proto = 0 # unsigned number
2003 |
2004 | # The number of newlines after a function prototype, if not followed by
2005 | # another function prototype.
2006 | nl_after_func_proto_group = 0 # unsigned number
2007 |
2008 | # The number of newlines after a class constructor/destructor prototype.
2009 | nl_after_func_class_proto = 0 # unsigned number
2010 |
2011 | # The number of newlines after a class constructor/destructor prototype,
2012 | # if not followed by another constructor/destructor prototype.
2013 | nl_after_func_class_proto_group = 0 # unsigned number
2014 |
2015 | # Whether one-line method definitions inside a class body should be treated
2016 | # as if they were prototypes for the purposes of adding newlines.
2017 | #
2018 | # Requires nl_class_leave_one_liners=true. Overrides nl_before_func_body_def
2019 | # and nl_before_func_class_def for one-liners.
2020 | nl_class_leave_one_liner_groups = false # true/false
2021 |
2022 | # The number of newlines after '}' of a multi-line function body.
2023 | nl_after_func_body = 0 # unsigned number
2024 |
2025 | # The number of newlines after '}' of a multi-line function body in a class
2026 | # declaration. Also affects class constructors/destructors.
2027 | #
2028 | # Overrides nl_after_func_body.
2029 | nl_after_func_body_class = 0 # unsigned number
2030 |
2031 | # The number of newlines after '}' of a single line function body. Also
2032 | # affects class constructors/destructors.
2033 | #
2034 | # Overrides nl_after_func_body and nl_after_func_body_class.
2035 | nl_after_func_body_one_liner = 0 # unsigned number
2036 |
2037 | # The number of blank lines after a block of variable definitions at the top
2038 | # of a function body.
2039 | #
2040 | # 0: No change (default).
2041 | nl_func_var_def_blk = 0 # unsigned number
2042 |
2043 | # The number of newlines before a block of typedefs. If nl_after_access_spec
2044 | # is non-zero, that option takes precedence.
2045 | #
2046 | # 0: No change (default).
2047 | nl_typedef_blk_start = 0 # unsigned number
2048 |
2049 | # The number of newlines after a block of typedefs.
2050 | #
2051 | # 0: No change (default).
2052 | nl_typedef_blk_end = 0 # unsigned number
2053 |
2054 | # The maximum number of consecutive newlines within a block of typedefs.
2055 | #
2056 | # 0: No change (default).
2057 | nl_typedef_blk_in = 0 # unsigned number
2058 |
2059 | # The number of newlines before a block of variable definitions not at the top
2060 | # of a function body. If nl_after_access_spec is non-zero, that option takes
2061 | # precedence.
2062 | #
2063 | # 0: No change (default).
2064 | nl_var_def_blk_start = 0 # unsigned number
2065 |
2066 | # The number of newlines after a block of variable definitions not at the top
2067 | # of a function body.
2068 | #
2069 | # 0: No change (default).
2070 | nl_var_def_blk_end = 0 # unsigned number
2071 |
2072 | # The maximum number of consecutive newlines within a block of variable
2073 | # definitions.
2074 | #
2075 | # 0: No change (default).
2076 | nl_var_def_blk_in = 0 # unsigned number
2077 |
2078 | # The minimum number of newlines before a multi-line comment.
2079 | # Doesn't apply if after a brace open or another multi-line comment.
2080 | nl_before_block_comment = 0 # unsigned number
2081 |
2082 | # The minimum number of newlines before a single-line C comment.
2083 | # Doesn't apply if after a brace open or other single-line C comments.
2084 | nl_before_c_comment = 0 # unsigned number
2085 |
2086 | # The minimum number of newlines before a CPP comment.
2087 | # Doesn't apply if after a brace open or other CPP comments.
2088 | nl_before_cpp_comment = 0 # unsigned number
2089 |
2090 | # Whether to force a newline after a multi-line comment.
2091 | nl_after_multiline_comment = false # true/false
2092 |
2093 | # Whether to force a newline after a label's colon.
2094 | nl_after_label_colon = false # true/false
2095 |
2096 | # The number of newlines after '}' or ';' of a struct/enum/union definition.
2097 | nl_after_struct = 0 # unsigned number
2098 |
2099 | # The number of newlines before a class definition.
2100 | nl_before_class = 0 # unsigned number
2101 |
2102 | # The number of newlines after '}' or ';' of a class definition.
2103 | nl_after_class = 0 # unsigned number
2104 |
2105 | # The number of newlines before a namespace.
2106 | nl_before_namespace = 0 # unsigned number
2107 |
2108 | # The number of newlines after '{' of a namespace. This also adds newlines
2109 | # before the matching '}'.
2110 | #
2111 | # 0: Apply eat_blanks_after_open_brace or eat_blanks_before_close_brace if
2112 | # applicable, otherwise no change.
2113 | #
2114 | # Overrides eat_blanks_after_open_brace and eat_blanks_before_close_brace.
2115 | nl_inside_namespace = 0 # unsigned number
2116 |
2117 | # The number of newlines after '}' of a namespace.
2118 | nl_after_namespace = 0 # unsigned number
2119 |
2120 | # The number of newlines before an access specifier label. This also includes
2121 | # the Qt-specific 'signals:' and 'slots:'. Will not change the newline count
2122 | # if after a brace open.
2123 | #
2124 | # 0: No change (default).
2125 | nl_before_access_spec = 0 # unsigned number
2126 |
2127 | # The number of newlines after an access specifier label. This also includes
2128 | # the Qt-specific 'signals:' and 'slots:'. Will not change the newline count
2129 | # if after a brace open.
2130 | #
2131 | # 0: No change (default).
2132 | #
2133 | # Overrides nl_typedef_blk_start and nl_var_def_blk_start.
2134 | nl_after_access_spec = 0 # unsigned number
2135 |
2136 | # The number of newlines between a function definition and the function
2137 | # comment, as in '// comment\n void foo() {...}'.
2138 | #
2139 | # 0: No change (default).
2140 | nl_comment_func_def = 0 # unsigned number
2141 |
2142 | # The number of newlines after a try-catch-finally block that isn't followed
2143 | # by a brace close.
2144 | #
2145 | # 0: No change (default).
2146 | nl_after_try_catch_finally = 0 # unsigned number
2147 |
2148 | # (C#) The number of newlines before and after a property, indexer or event
2149 | # declaration.
2150 | #
2151 | # 0: No change (default).
2152 | nl_around_cs_property = 0 # unsigned number
2153 |
2154 | # (C#) The number of newlines between the get/set/add/remove handlers.
2155 | #
2156 | # 0: No change (default).
2157 | nl_between_get_set = 0 # unsigned number
2158 |
2159 | # (C#) Add or remove newline between property and the '{'.
2160 | nl_property_brace = ignore # ignore/add/remove/force
2161 |
2162 | # Whether to remove blank lines after '{'.
2163 | eat_blanks_after_open_brace = false # true/false
2164 |
2165 | # Whether to remove blank lines before '}'.
2166 | eat_blanks_before_close_brace = false # true/false
2167 |
2168 | # How aggressively to remove extra newlines not in preprocessor.
2169 | #
2170 | # 0: No change (default)
2171 | # 1: Remove most newlines not handled by other config
2172 | # 2: Remove all newlines and reformat completely by config
2173 | nl_remove_extra_newlines = 0 # unsigned number
2174 |
2175 | # (Java) Add or remove newline after an annotation statement. Only affects
2176 | # annotations that are after a newline.
2177 | nl_after_annotation = ignore # ignore/add/remove/force
2178 |
2179 | # (Java) Add or remove newline between two annotations.
2180 | nl_between_annotation = ignore # ignore/add/remove/force
2181 |
2182 | # The number of newlines before a whole-file #ifdef.
2183 | #
2184 | # 0: No change (default).
2185 | nl_before_whole_file_ifdef = 0 # unsigned number
2186 |
2187 | # The number of newlines after a whole-file #ifdef.
2188 | #
2189 | # 0: No change (default).
2190 | nl_after_whole_file_ifdef = 0 # unsigned number
2191 |
2192 | # The number of newlines before a whole-file #endif.
2193 | #
2194 | # 0: No change (default).
2195 | nl_before_whole_file_endif = 0 # unsigned number
2196 |
2197 | # The number of newlines after a whole-file #endif.
2198 | #
2199 | # 0: No change (default).
2200 | nl_after_whole_file_endif = 0 # unsigned number
2201 |
2202 | #
2203 | # Positioning options
2204 | #
2205 |
2206 | # The position of arithmetic operators in wrapped expressions.
2207 | pos_arith = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
2208 |
2209 | # The position of assignment in wrapped expressions. Do not affect '='
2210 | # followed by '{'.
2211 | pos_assign = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
2212 |
2213 | # The position of Boolean operators in wrapped expressions.
2214 | pos_bool = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
2215 |
2216 | # The position of comparison operators in wrapped expressions.
2217 | pos_compare = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
2218 |
2219 | # The position of conditional operators, as in the '?' and ':' of
2220 | # 'expr ? stmt : stmt', in wrapped expressions.
2221 | pos_conditional = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
2222 |
2223 | # The position of the comma in wrapped expressions.
2224 | pos_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
2225 |
2226 | # The position of the comma in enum entries.
2227 | pos_enum_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
2228 |
2229 | # The position of the comma in the base class list if there is more than one
2230 | # line. Affects nl_class_init_args.
2231 | pos_class_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
2232 |
2233 | # The position of the comma in the constructor initialization list.
2234 | # Related to nl_constr_colon, nl_constr_init_args and pos_constr_colon.
2235 | pos_constr_comma = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
2236 |
2237 | # The position of trailing/leading class colon, between class and base class
2238 | # list. Affects nl_class_colon.
2239 | pos_class_colon = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
2240 |
2241 | # The position of colons between constructor and member initialization.
2242 | # Related to nl_constr_colon, nl_constr_init_args and pos_constr_comma.
2243 | pos_constr_colon = ignore # ignore/break/force/lead/trail/join/lead_break/lead_force/trail_break/trail_force
2244 |
2245 | #
2246 | # Line splitting options
2247 | #
2248 |
2249 | # Try to limit code width to N columns.
2250 | code_width = 0 # unsigned number
2251 |
2252 | # Whether to fully split long 'for' statements at semi-colons.
2253 | ls_for_split_full = false # true/false
2254 |
2255 | # Whether to fully split long function prototypes/calls at commas.
2256 | # The option ls_code_width has priority over the option ls_func_split_full.
2257 | ls_func_split_full = false # true/false
2258 |
2259 | # Whether to split lines as close to code_width as possible and ignore some
2260 | # groupings.
2261 | # The option ls_code_width has priority over the option ls_func_split_full.
2262 | ls_code_width = false # true/false
2263 |
2264 | #
2265 | # Code alignment options (not left column spaces/tabs)
2266 | #
2267 |
2268 | # Whether to keep non-indenting tabs.
2269 | align_keep_tabs = false # true/false
2270 |
2271 | # Whether to use tabs for aligning.
2272 | align_with_tabs = false # true/false
2273 |
2274 | # Whether to bump out to the next tab when aligning.
2275 | align_on_tabstop = false # true/false
2276 |
2277 | # Whether to right-align numbers.
2278 | align_number_right = false # true/false
2279 |
2280 | # Whether to keep whitespace not required for alignment.
2281 | align_keep_extra_space = false # true/false
2282 |
2283 | # Whether to align variable definitions in prototypes and functions.
2284 | align_func_params = false # true/false
2285 |
2286 | # The span for aligning parameter definitions in function on parameter name.
2287 | #
2288 | # 0: Don't align (default).
2289 | align_func_params_span = 0 # unsigned number
2290 |
2291 | # The threshold for aligning function parameter definitions.
2292 | # Use a negative number for absolute thresholds.
2293 | #
2294 | # 0: No limit (default).
2295 | align_func_params_thresh = 0 # number
2296 |
2297 | # The gap for aligning function parameter definitions.
2298 | align_func_params_gap = 0 # unsigned number
2299 |
2300 | # The span for aligning constructor value.
2301 | #
2302 | # 0: Don't align (default).
2303 | align_constr_value_span = 0 # unsigned number
2304 |
2305 | # The threshold for aligning constructor value.
2306 | # Use a negative number for absolute thresholds.
2307 | #
2308 | # 0: No limit (default).
2309 | align_constr_value_thresh = 0 # number
2310 |
2311 | # The gap for aligning constructor value.
2312 | align_constr_value_gap = 0 # unsigned number
2313 |
2314 | # Whether to align parameters in single-line functions that have the same
2315 | # name. The function names must already be aligned with each other.
2316 | align_same_func_call_params = false # true/false
2317 |
2318 | # The span for aligning function-call parameters for single line functions.
2319 | #
2320 | # 0: Don't align (default).
2321 | align_same_func_call_params_span = 0 # unsigned number
2322 |
2323 | # The threshold for aligning function-call parameters for single line
2324 | # functions.
2325 | # Use a negative number for absolute thresholds.
2326 | #
2327 | # 0: No limit (default).
2328 | align_same_func_call_params_thresh = 0 # number
2329 |
2330 | # The span for aligning variable definitions.
2331 | #
2332 | # 0: Don't align (default).
2333 | align_var_def_span = 0 # unsigned number
2334 |
2335 | # How to consider (or treat) the '*' in the alignment of variable definitions.
2336 | #
2337 | # 0: Part of the type 'void * foo;' (default)
2338 | # 1: Part of the variable 'void *foo;'
2339 | # 2: Dangling 'void *foo;'
2340 | # Dangling: the '*' will not be taken into account when aligning.
2341 | align_var_def_star_style = 0 # unsigned number
2342 |
2343 | # How to consider (or treat) the '&' in the alignment of variable definitions.
2344 | #
2345 | # 0: Part of the type 'long & foo;' (default)
2346 | # 1: Part of the variable 'long &foo;'
2347 | # 2: Dangling 'long &foo;'
2348 | # Dangling: the '&' will not be taken into account when aligning.
2349 | align_var_def_amp_style = 0 # unsigned number
2350 |
2351 | # The threshold for aligning variable definitions.
2352 | # Use a negative number for absolute thresholds.
2353 | #
2354 | # 0: No limit (default).
2355 | align_var_def_thresh = 0 # number
2356 |
2357 | # The gap for aligning variable definitions.
2358 | align_var_def_gap = 0 # unsigned number
2359 |
2360 | # Whether to align the colon in struct bit fields.
2361 | align_var_def_colon = false # true/false
2362 |
2363 | # The gap for aligning the colon in struct bit fields.
2364 | align_var_def_colon_gap = 0 # unsigned number
2365 |
2366 | # Whether to align any attribute after the variable name.
2367 | align_var_def_attribute = false # true/false
2368 |
2369 | # Whether to align inline struct/enum/union variable definitions.
2370 | align_var_def_inline = false # true/false
2371 |
2372 | # The span for aligning on '=' in assignments.
2373 | #
2374 | # 0: Don't align (default).
2375 | align_assign_span = 0 # unsigned number
2376 |
2377 | # The span for aligning on '=' in function prototype modifier.
2378 | #
2379 | # 0: Don't align (default).
2380 | align_assign_func_proto_span = 0 # unsigned number
2381 |
2382 | # The threshold for aligning on '=' in assignments.
2383 | # Use a negative number for absolute thresholds.
2384 | #
2385 | # 0: No limit (default).
2386 | align_assign_thresh = 0 # number
2387 |
2388 | # How to apply align_assign_span to function declaration "assignments", i.e.
2389 | # 'virtual void foo() = 0' or '~foo() = {default|delete}'.
2390 | #
2391 | # 0: Align with other assignments (default)
2392 | # 1: Align with each other, ignoring regular assignments
2393 | # 2: Don't align
2394 | align_assign_decl_func = 0 # unsigned number
2395 |
2396 | # The span for aligning on '=' in enums.
2397 | #
2398 | # 0: Don't align (default).
2399 | align_enum_equ_span = 0 # unsigned number
2400 |
2401 | # The threshold for aligning on '=' in enums.
2402 | # Use a negative number for absolute thresholds.
2403 | #
2404 | # 0: no limit (default).
2405 | align_enum_equ_thresh = 0 # number
2406 |
2407 | # The span for aligning class member definitions.
2408 | #
2409 | # 0: Don't align (default).
2410 | align_var_class_span = 0 # unsigned number
2411 |
2412 | # The threshold for aligning class member definitions.
2413 | # Use a negative number for absolute thresholds.
2414 | #
2415 | # 0: No limit (default).
2416 | align_var_class_thresh = 0 # number
2417 |
2418 | # The gap for aligning class member definitions.
2419 | align_var_class_gap = 0 # unsigned number
2420 |
2421 | # The span for aligning struct/union member definitions.
2422 | #
2423 | # 0: Don't align (default).
2424 | align_var_struct_span = 0 # unsigned number
2425 |
2426 | # The threshold for aligning struct/union member definitions.
2427 | # Use a negative number for absolute thresholds.
2428 | #
2429 | # 0: No limit (default).
2430 | align_var_struct_thresh = 0 # number
2431 |
2432 | # The gap for aligning struct/union member definitions.
2433 | align_var_struct_gap = 0 # unsigned number
2434 |
2435 | # The span for aligning struct initializer values.
2436 | #
2437 | # 0: Don't align (default).
2438 | align_struct_init_span = 0 # unsigned number
2439 |
2440 | # The span for aligning single-line typedefs.
2441 | #
2442 | # 0: Don't align (default).
2443 | align_typedef_span = 0 # unsigned number
2444 |
2445 | # The minimum space between the type and the synonym of a typedef.
2446 | align_typedef_gap = 0 # unsigned number
2447 |
2448 | # How to align typedef'd functions with other typedefs.
2449 | #
2450 | # 0: Don't mix them at all (default)
2451 | # 1: Align the open parenthesis with the types
2452 | # 2: Align the function type name with the other type names
2453 | align_typedef_func = 0 # unsigned number
2454 |
2455 | # How to consider (or treat) the '*' in the alignment of typedefs.
2456 | #
2457 | # 0: Part of the typedef type, 'typedef int * pint;' (default)
2458 | # 1: Part of type name: 'typedef int *pint;'
2459 | # 2: Dangling: 'typedef int *pint;'
2460 | # Dangling: the '*' will not be taken into account when aligning.
2461 | align_typedef_star_style = 0 # unsigned number
2462 |
2463 | # How to consider (or treat) the '&' in the alignment of typedefs.
2464 | #
2465 | # 0: Part of the typedef type, 'typedef int & intref;' (default)
2466 | # 1: Part of type name: 'typedef int &intref;'
2467 | # 2: Dangling: 'typedef int &intref;'
2468 | # Dangling: the '&' will not be taken into account when aligning.
2469 | align_typedef_amp_style = 0 # unsigned number
2470 |
2471 | # The span for aligning comments that end lines.
2472 | #
2473 | # 0: Don't align (default).
2474 | align_right_cmt_span = 0 # unsigned number
2475 |
2476 | # Minimum number of columns between preceding text and a trailing comment in
2477 | # order for the comment to qualify for being aligned. Must be non-zero to have
2478 | # an effect.
2479 | align_right_cmt_gap = 0 # unsigned number
2480 |
2481 | # If aligning comments, whether to mix with comments after '}' and #endif with
2482 | # less than three spaces before the comment.
2483 | align_right_cmt_mix = false # true/false
2484 |
2485 | # Whether to only align trailing comments that are at the same brace level.
2486 | align_right_cmt_same_level = false # true/false
2487 |
2488 | # Minimum column at which to align trailing comments. Comments which are
2489 | # aligned beyond this column, but which can be aligned in a lesser column,
2490 | # may be "pulled in".
2491 | #
2492 | # 0: Ignore (default).
2493 | align_right_cmt_at_col = 0 # unsigned number
2494 |
2495 | # The span for aligning function prototypes.
2496 | #
2497 | # 0: Don't align (default).
2498 | align_func_proto_span = 0 # unsigned number
2499 |
2500 | # The threshold for aligning function prototypes.
2501 | # Use a negative number for absolute thresholds.
2502 | #
2503 | # 0: No limit (default).
2504 | align_func_proto_thresh = 0 # number
2505 |
2506 | # Minimum gap between the return type and the function name.
2507 | align_func_proto_gap = 0 # unsigned number
2508 |
2509 | # Whether to align function prototypes on the 'operator' keyword instead of
2510 | # what follows.
2511 | align_on_operator = false # true/false
2512 |
2513 | # Whether to mix aligning prototype and variable declarations. If true,
2514 | # align_var_def_XXX options are used instead of align_func_proto_XXX options.
2515 | align_mix_var_proto = false # true/false
2516 |
2517 | # Whether to align single-line functions with function prototypes.
2518 | # Uses align_func_proto_span.
2519 | align_single_line_func = false # true/false
2520 |
2521 | # Whether to align the open brace of single-line functions.
2522 | # Requires align_single_line_func=true. Uses align_func_proto_span.
2523 | align_single_line_brace = false # true/false
2524 |
2525 | # Gap for align_single_line_brace.
2526 | align_single_line_brace_gap = 0 # unsigned number
2527 |
2528 | # (OC) The span for aligning Objective-C message specifications.
2529 | #
2530 | # 0: Don't align (default).
2531 | align_oc_msg_spec_span = 0 # unsigned number
2532 |
2533 | # Whether to align macros wrapped with a backslash and a newline. This will
2534 | # not work right if the macro contains a multi-line comment.
2535 | align_nl_cont = false # true/false
2536 |
2537 | # Whether to align macro functions and variables together.
2538 | align_pp_define_together = false # true/false
2539 |
2540 | # The span for aligning on '#define' bodies.
2541 | #
2542 | # =0: Don't align (default)
2543 | # >0: Number of lines (including comments) between blocks
2544 | align_pp_define_span = 0 # unsigned number
2545 |
2546 | # The minimum space between label and value of a preprocessor define.
2547 | align_pp_define_gap = 0 # unsigned number
2548 |
2549 | # Whether to align lines that start with '<<' with previous '<<'.
2550 | #
2551 | # Default: true
2552 | align_left_shift = true # true/false
2553 |
2554 | # Whether to align text after 'asm volatile ()' colons.
2555 | align_asm_colon = false # true/false
2556 |
2557 | # (OC) Span for aligning parameters in an Objective-C message call
2558 | # on the ':'.
2559 | #
2560 | # 0: Don't align.
2561 | align_oc_msg_colon_span = 0 # unsigned number
2562 |
2563 | # (OC) Whether to always align with the first parameter, even if it is too
2564 | # short.
2565 | align_oc_msg_colon_first = false # true/false
2566 |
2567 | # (OC) Whether to align parameters in an Objective-C '+' or '-' declaration
2568 | # on the ':'.
2569 | align_oc_decl_colon = false # true/false
2570 |
2571 | # (OC) Whether to not align parameters in an Objectve-C message call if first
2572 | # colon is not on next line of the message call (the same way Xcode does
2573 | # aligment)
2574 | align_oc_msg_colon_xcode_like = false # true/false
2575 |
2576 | #
2577 | # Comment modification options
2578 | #
2579 |
2580 | # Try to wrap comments at N columns.
2581 | cmt_width = 0 # unsigned number
2582 |
2583 | # How to reflow comments.
2584 | #
2585 | # 0: No reflowing (apart from the line wrapping due to cmt_width) (default)
2586 | # 1: No touching at all
2587 | # 2: Full reflow
2588 | cmt_reflow_mode = 0 # unsigned number
2589 |
2590 | # Whether to convert all tabs to spaces in comments. If false, tabs in
2591 | # comments are left alone, unless used for indenting.
2592 | cmt_convert_tab_to_spaces = false # true/false
2593 |
2594 | # Whether to apply changes to multi-line comments, including cmt_width,
2595 | # keyword substitution and leading chars.
2596 | #
2597 | # Default: true
2598 | cmt_indent_multi = true # true/false
2599 |
2600 | # Whether to group c-comments that look like they are in a block.
2601 | cmt_c_group = false # true/false
2602 |
2603 | # Whether to put an empty '/*' on the first line of the combined c-comment.
2604 | cmt_c_nl_start = false # true/false
2605 |
2606 | # Whether to add a newline before the closing '*/' of the combined c-comment.
2607 | cmt_c_nl_end = false # true/false
2608 |
2609 | # Whether to change cpp-comments into c-comments.
2610 | cmt_cpp_to_c = false # true/false
2611 |
2612 | # Whether to group cpp-comments that look like they are in a block. Only
2613 | # meaningful if cmt_cpp_to_c=true.
2614 | cmt_cpp_group = false # true/false
2615 |
2616 | # Whether to put an empty '/*' on the first line of the combined cpp-comment
2617 | # when converting to a c-comment.
2618 | #
2619 | # Requires cmt_cpp_to_c=true and cmt_cpp_group=true.
2620 | cmt_cpp_nl_start = false # true/false
2621 |
2622 | # Whether to add a newline before the closing '*/' of the combined cpp-comment
2623 | # when converting to a c-comment.
2624 | #
2625 | # Requires cmt_cpp_to_c=true and cmt_cpp_group=true.
2626 | cmt_cpp_nl_end = false # true/false
2627 |
2628 | # Whether to put a star on subsequent comment lines.
2629 | cmt_star_cont = false # true/false
2630 |
2631 | # The number of spaces to insert at the start of subsequent comment lines.
2632 | cmt_sp_before_star_cont = 0 # unsigned number
2633 |
2634 | # The number of spaces to insert after the star on subsequent comment lines.
2635 | cmt_sp_after_star_cont = 0 # unsigned number
2636 |
2637 | # For multi-line comments with a '*' lead, remove leading spaces if the first
2638 | # and last lines of the comment are the same length.
2639 | #
2640 | # Default: true
2641 | cmt_multi_check_last = true # true/false
2642 |
2643 | # For multi-line comments with a '*' lead, remove leading spaces if the first
2644 | # and last lines of the comment are the same length AND if the length is
2645 | # bigger as the first_len minimum.
2646 | #
2647 | # Default: 4
2648 | cmt_multi_first_len_minimum = 4 # unsigned number
2649 |
2650 | # Path to a file that contains text to insert at the beginning of a file if
2651 | # the file doesn't start with a C/C++ comment. If the inserted text contains
2652 | # '$(filename)', that will be replaced with the current file's name.
2653 | cmt_insert_file_header = "" # string
2654 |
2655 | # Path to a file that contains text to insert at the end of a file if the
2656 | # file doesn't end with a C/C++ comment. If the inserted text contains
2657 | # '$(filename)', that will be replaced with the current file's name.
2658 | cmt_insert_file_footer = "" # string
2659 |
2660 | # Path to a file that contains text to insert before a function definition if
2661 | # the function isn't preceded by a C/C++ comment. If the inserted text
2662 | # contains '$(function)', '$(javaparam)' or '$(fclass)', these will be
2663 | # replaced with, respectively, the name of the function, the javadoc '@param'
2664 | # and '@return' stuff, or the name of the class to which the member function
2665 | # belongs.
2666 | cmt_insert_func_header = "" # string
2667 |
2668 | # Path to a file that contains text to insert before a class if the class
2669 | # isn't preceded by a C/C++ comment. If the inserted text contains '$(class)',
2670 | # that will be replaced with the class name.
2671 | cmt_insert_class_header = "" # string
2672 |
2673 | # Path to a file that contains text to insert before an Objective-C message
2674 | # specification, if the method isn't preceded by a C/C++ comment. If the
2675 | # inserted text contains '$(message)' or '$(javaparam)', these will be
2676 | # replaced with, respectively, the name of the function, or the javadoc
2677 | # '@param' and '@return' stuff.
2678 | cmt_insert_oc_msg_header = "" # string
2679 |
2680 | # Whether a comment should be inserted if a preprocessor is encountered when
2681 | # stepping backwards from a function name.
2682 | #
2683 | # Applies to cmt_insert_oc_msg_header, cmt_insert_func_header and
2684 | # cmt_insert_class_header.
2685 | cmt_insert_before_preproc = false # true/false
2686 |
2687 | # Whether a comment should be inserted if a function is declared inline to a
2688 | # class definition.
2689 | #
2690 | # Applies to cmt_insert_func_header.
2691 | #
2692 | # Default: true
2693 | cmt_insert_before_inlines = true # true/false
2694 |
2695 | # Whether a comment should be inserted if the function is a class constructor
2696 | # or destructor.
2697 | #
2698 | # Applies to cmt_insert_func_header.
2699 | cmt_insert_before_ctor_dtor = false # true/false
2700 |
2701 | #
2702 | # Code modifying options (non-whitespace)
2703 | #
2704 |
2705 | # Add or remove braces on a single-line 'do' statement.
2706 | mod_full_brace_do = ignore # ignore/add/remove/force
2707 |
2708 | # Add or remove braces on a single-line 'for' statement.
2709 | mod_full_brace_for = ignore # ignore/add/remove/force
2710 |
2711 | # (Pawn) Add or remove braces on a single-line function definition.
2712 | mod_full_brace_function = ignore # ignore/add/remove/force
2713 |
2714 | # Add or remove braces on a single-line 'if' statement. Braces will not be
2715 | # removed if the braced statement contains an 'else'.
2716 | mod_full_brace_if = ignore # ignore/add/remove/force
2717 |
2718 | # Whether to enforce that all blocks of an 'if'/'else if'/'else' chain either
2719 | # have, or do not have, braces. If true, braces will be added if any block
2720 | # needs braces, and will only be removed if they can be removed from all
2721 | # blocks.
2722 | #
2723 | # Overrides mod_full_brace_if.
2724 | mod_full_brace_if_chain = false # true/false
2725 |
2726 | # Whether to add braces to all blocks of an 'if'/'else if'/'else' chain.
2727 | # If true, mod_full_brace_if_chain will only remove braces from an 'if' that
2728 | # does not have an 'else if' or 'else'.
2729 | mod_full_brace_if_chain_only = false # true/false
2730 |
2731 | # Add or remove braces on single-line 'while' statement.
2732 | mod_full_brace_while = ignore # ignore/add/remove/force
2733 |
2734 | # Add or remove braces on single-line 'using ()' statement.
2735 | mod_full_brace_using = ignore # ignore/add/remove/force
2736 |
2737 | # Don't remove braces around statements that span N newlines
2738 | mod_full_brace_nl = 0 # unsigned number
2739 |
2740 | # Whether to prevent removal of braces from 'if'/'for'/'while'/etc. blocks
2741 | # which span multiple lines.
2742 | #
2743 | # Affects:
2744 | # mod_full_brace_for
2745 | # mod_full_brace_if
2746 | # mod_full_brace_if_chain
2747 | # mod_full_brace_if_chain_only
2748 | # mod_full_brace_while
2749 | # mod_full_brace_using
2750 | #
2751 | # Does not affect:
2752 | # mod_full_brace_do
2753 | # mod_full_brace_function
2754 | mod_full_brace_nl_block_rem_mlcond = false # true/false
2755 |
2756 | # Add or remove unnecessary parenthesis on 'return' statement.
2757 | mod_paren_on_return = ignore # ignore/add/remove/force
2758 |
2759 | # (Pawn) Whether to change optional semicolons to real semicolons.
2760 | mod_pawn_semicolon = false # true/false
2761 |
2762 | # Whether to fully parenthesize Boolean expressions in 'while' and 'if'
2763 | # statement, as in 'if (a && b > c)' => 'if (a && (b > c))'.
2764 | mod_full_paren_if_bool = false # true/false
2765 |
2766 | # Whether to remove superfluous semicolons.
2767 | mod_remove_extra_semicolon = false # true/false
2768 |
2769 | # If a function body exceeds the specified number of newlines and doesn't have
2770 | # a comment after the close brace, a comment will be added.
2771 | mod_add_long_function_closebrace_comment = 0 # unsigned number
2772 |
2773 | # If a namespace body exceeds the specified number of newlines and doesn't
2774 | # have a comment after the close brace, a comment will be added.
2775 | mod_add_long_namespace_closebrace_comment = 0 # unsigned number
2776 |
2777 | # If a class body exceeds the specified number of newlines and doesn't have a
2778 | # comment after the close brace, a comment will be added.
2779 | mod_add_long_class_closebrace_comment = 0 # unsigned number
2780 |
2781 | # If a switch body exceeds the specified number of newlines and doesn't have a
2782 | # comment after the close brace, a comment will be added.
2783 | mod_add_long_switch_closebrace_comment = 0 # unsigned number
2784 |
2785 | # If an #ifdef body exceeds the specified number of newlines and doesn't have
2786 | # a comment after the #endif, a comment will be added.
2787 | mod_add_long_ifdef_endif_comment = 0 # unsigned number
2788 |
2789 | # If an #ifdef or #else body exceeds the specified number of newlines and
2790 | # doesn't have a comment after the #else, a comment will be added.
2791 | mod_add_long_ifdef_else_comment = 0 # unsigned number
2792 |
2793 | # Whether to take care of the case by the mod_sort_xx options.
2794 | mod_sort_case_sensitive = false # true/false
2795 |
2796 | # Whether to sort consecutive single-line 'import' statements.
2797 | mod_sort_import = false # true/false
2798 |
2799 | # (C#) Whether to sort consecutive single-line 'using' statements.
2800 | mod_sort_using = false # true/false
2801 |
2802 | # Whether to sort consecutive single-line '#include' statements (C/C++) and
2803 | # '#import' statements (Objective-C). Be aware that this has the potential to
2804 | # break your code if your includes/imports have ordering dependencies.
2805 | mod_sort_include = false # true/false
2806 |
2807 | # Whether to prioritize '#include' and '#import' statements that contain
2808 | # filename without extension when sorting is enabled.
2809 | mod_sort_incl_import_prioritize_filename = false # true/false
2810 |
2811 | # Whether to prioritize '#include' and '#import' statements that does not
2812 | # contain extensions when sorting is enabled.
2813 | mod_sort_incl_import_prioritize_extensionless = false # true/false
2814 |
2815 | # Whether to prioritize '#include' and '#import' statements that contain
2816 | # angle over quotes when sorting is enabled.
2817 | mod_sort_incl_import_prioritize_angle_over_quotes = false # true/false
2818 |
2819 | # Whether to ignore file extension in '#include' and '#import' statements
2820 | # for sorting comparison.
2821 | mod_sort_incl_import_ignore_extension = false # true/false
2822 |
2823 | # Whether to group '#include' and '#import' statements when sorting is enabled.
2824 | mod_sort_incl_import_grouping_enabled = false # true/false
2825 |
2826 | # Whether to move a 'break' that appears after a fully braced 'case' before
2827 | # the close brace, as in 'case X: { ... } break;' => 'case X: { ... break; }'.
2828 | mod_move_case_break = false # true/false
2829 |
2830 | # Add or remove braces around a fully braced case statement. Will only remove
2831 | # braces if there are no variable declarations in the block.
2832 | mod_case_brace = ignore # ignore/add/remove/force
2833 |
2834 | # Whether to remove a void 'return;' that appears as the last statement in a
2835 | # function.
2836 | mod_remove_empty_return = false # true/false
2837 |
2838 | # Add or remove the comma after the last value of an enumeration.
2839 | mod_enum_last_comma = ignore # ignore/add/remove/force
2840 |
2841 | # (OC) Whether to organize the properties. If true, properties will be
2842 | # rearranged according to the mod_sort_oc_property_*_weight factors.
2843 | mod_sort_oc_properties = false # true/false
2844 |
2845 | # (OC) Weight of a class property modifier.
2846 | mod_sort_oc_property_class_weight = 0 # number
2847 |
2848 | # (OC) Weight of 'atomic' and 'nonatomic'.
2849 | mod_sort_oc_property_thread_safe_weight = 0 # number
2850 |
2851 | # (OC) Weight of 'readwrite' when organizing properties.
2852 | mod_sort_oc_property_readwrite_weight = 0 # number
2853 |
2854 | # (OC) Weight of a reference type specifier ('retain', 'copy', 'assign',
2855 | # 'weak', 'strong') when organizing properties.
2856 | mod_sort_oc_property_reference_weight = 0 # number
2857 |
2858 | # (OC) Weight of getter type ('getter=') when organizing properties.
2859 | mod_sort_oc_property_getter_weight = 0 # number
2860 |
2861 | # (OC) Weight of setter type ('setter=') when organizing properties.
2862 | mod_sort_oc_property_setter_weight = 0 # number
2863 |
2864 | # (OC) Weight of nullability type ('nullable', 'nonnull', 'null_unspecified',
2865 | # 'null_resettable') when organizing properties.
2866 | mod_sort_oc_property_nullability_weight = 0 # number
2867 |
2868 | #
2869 | # Preprocessor options
2870 | #
2871 |
2872 | # Add or remove indentation of preprocessor directives inside #if blocks
2873 | # at brace level 0 (file-level).
2874 | pp_indent = ignore # ignore/add/remove/force
2875 |
2876 | # Whether to indent #if/#else/#endif at the brace level. If false, these are
2877 | # indented from column 1.
2878 | pp_indent_at_level = false # true/false
2879 |
2880 | # Specifies the number of columns to indent preprocessors per level
2881 | # at brace level 0 (file-level). If pp_indent_at_level=false, also specifies
2882 | # the number of columns to indent preprocessors per level
2883 | # at brace level > 0 (function-level).
2884 | #
2885 | # Default: 1
2886 | pp_indent_count = 1 # unsigned number
2887 |
2888 | # Add or remove space after # based on pp_level of #if blocks.
2889 | pp_space = ignore # ignore/add/remove/force
2890 |
2891 | # Sets the number of spaces per level added with pp_space.
2892 | pp_space_count = 0 # unsigned number
2893 |
2894 | # The indent for '#region' and '#endregion' in C# and '#pragma region' in
2895 | # C/C++. Negative values decrease indent down to the first column.
2896 | pp_indent_region = 0 # number
2897 |
2898 | # Whether to indent the code between #region and #endregion.
2899 | pp_region_indent_code = false # true/false
2900 |
2901 | # If pp_indent_at_level=true, sets the indent for #if, #else and #endif when
2902 | # not at file-level. Negative values decrease indent down to the first column.
2903 | #
2904 | # =0: Indent preprocessors using output_tab_size
2905 | # >0: Column at which all preprocessors will be indented
2906 | pp_indent_if = 0 # number
2907 |
2908 | # Whether to indent the code between #if, #else and #endif.
2909 | pp_if_indent_code = false # true/false
2910 |
2911 | # Whether to indent '#define' at the brace level. If false, these are
2912 | # indented from column 1.
2913 | pp_define_at_level = false # true/false
2914 |
2915 | # Whether to ignore the '#define' body while formatting.
2916 | pp_ignore_define_body = false # true/false
2917 |
2918 | # Whether to indent case statements between #if, #else, and #endif.
2919 | # Only applies to the indent of the preprocesser that the case statements
2920 | # directly inside of.
2921 | #
2922 | # Default: true
2923 | pp_indent_case = true # true/false
2924 |
2925 | # Whether to indent whole function definitions between #if, #else, and #endif.
2926 | # Only applies to the indent of the preprocesser that the function definition
2927 | # is directly inside of.
2928 | #
2929 | # Default: true
2930 | pp_indent_func_def = true # true/false
2931 |
2932 | # Whether to indent extern C blocks between #if, #else, and #endif.
2933 | # Only applies to the indent of the preprocesser that the extern block is
2934 | # directly inside of.
2935 | #
2936 | # Default: true
2937 | pp_indent_extern = true # true/false
2938 |
2939 | # Whether to indent braces directly inside #if, #else, and #endif.
2940 | # Only applies to the indent of the preprocesser that the braces are directly
2941 | # inside of.
2942 | #
2943 | # Default: true
2944 | pp_indent_brace = true # true/false
2945 |
2946 | #
2947 | # Sort includes options
2948 | #
2949 |
2950 | # The regex for include category with priority 0.
2951 | include_category_0 = "" # string
2952 |
2953 | # The regex for include category with priority 1.
2954 | include_category_1 = "" # string
2955 |
2956 | # The regex for include category with priority 2.
2957 | include_category_2 = "" # string
2958 |
2959 | #
2960 | # Use or Do not Use options
2961 | #
2962 |
2963 | # true: indent_func_call_param will be used (default)
2964 | # false: indent_func_call_param will NOT be used
2965 | #
2966 | # Default: true
2967 | use_indent_func_call_param = true # true/false
2968 |
2969 | # The value of the indentation for a continuation line is calculated
2970 | # differently if the statement is:
2971 | # - a declaration: your case with QString fileName ...
2972 | # - an assignment: your case with pSettings = new QSettings( ...
2973 | #
2974 | # At the second case the indentation value might be used twice:
2975 | # - at the assignment
2976 | # - at the function call (if present)
2977 | #
2978 | # To prevent the double use of the indentation value, use this option with the
2979 | # value 'true'.
2980 | #
2981 | # true: indent_continue will be used only once
2982 | # false: indent_continue will be used every time (default)
2983 | use_indent_continue_only_once = false # true/false
2984 |
2985 | # The value might be used twice:
2986 | # - at the assignment
2987 | # - at the opening brace
2988 | #
2989 | # To prevent the double use of the indentation value, use this option with the
2990 | # value 'true'.
2991 | #
2992 | # true: indentation will be used only once
2993 | # false: indentation will be used every time (default)
2994 | indent_cpp_lambda_only_once = false # true/false
2995 |
2996 | # Whether sp_after_angle takes precedence over sp_inside_fparen. This was the
2997 | # historic behavior, but is probably not the desired behavior, so this is off
2998 | # by default.
2999 | use_sp_after_angle_always = false # true/false
3000 |
3001 | # Whether to apply special formatting for Qt SIGNAL/SLOT macros. Essentially,
3002 | # this tries to format these so that they match Qt's normalized form (i.e. the
3003 | # result of QMetaObject::normalizedSignature), which can slightly improve the
3004 | # performance of the QObject::connect call, rather than how they would
3005 | # otherwise be formatted.
3006 | #
3007 | # See options_for_QT.cpp for details.
3008 | #
3009 | # Default: true
3010 | use_options_overriding_for_qt_macros = true # true/false
3011 |
3012 | # If true: the form feed character is removed from the list
3013 | # of whitespace characters.
3014 | # See https://en.cppreference.com/w/cpp/string/byte/isspace
3015 | use_form_feed_no_more_as_whitespace_character = false # true/false
3016 |
3017 | #
3018 | # Warn levels - 1: error, 2: warning (default), 3: note
3019 | #
3020 |
3021 | # (C#) Warning is given if doing tab-to-\t replacement and we have found one
3022 | # in a C# verbatim string literal.
3023 | #
3024 | # Default: 2
3025 | warn_level_tabs_found_in_verbatim_string_literals = 2 # unsigned number
3026 |
3027 | # Limit the number of loops.
3028 | # Used by uncrustify.cpp to exit from infinite loop.
3029 | # 0: no limit.
3030 | debug_max_number_of_loops = 0 # number
3031 |
3032 | # Set the number of the line to protocol;
3033 | # Used in the function prot_the_line if the 2. parameter is zero.
3034 | # 0: nothing protocol.
3035 | debug_line_number_to_protocol = 0 # number
3036 |
3037 | # Meaning of the settings:
3038 | # Ignore - do not do any changes
3039 | # Add - makes sure there is 1 or more space/brace/newline/etc
3040 | # Force - makes sure there is exactly 1 space/brace/newline/etc,
3041 | # behaves like Add in some contexts
3042 | # Remove - removes space/brace/newline/etc
3043 | #
3044 | #
3045 | # - Token(s) can be treated as specific type(s) with the 'set' option:
3046 | # `set tokenType tokenString [tokenString...]`
3047 | #
3048 | # Example:
3049 | # `set BOOL __AND__ __OR__`
3050 | #
3051 | # tokenTypes are defined in src/token_enum.h, use them without the
3052 | # 'CT_' prefix: 'CT_BOOL' => 'BOOL'
3053 | #
3054 | #
3055 | # - Token(s) can be treated as type(s) with the 'type' option.
3056 | # `type tokenString [tokenString...]`
3057 | #
3058 | # Example:
3059 | # `type int c_uint_8 Rectangle`
3060 | #
3061 | # This can also be achieved with `set TYPE int c_uint_8 Rectangle`
3062 | #
3063 | #
3064 | # To embed whitespace in tokenStrings use the '\' escape character, or quote
3065 | # the tokenStrings. These quotes are supported: "'`
3066 | #
3067 | #
3068 | # - Support for the auto detection of languages through the file ending can be
3069 | # added using the 'file_ext' command.
3070 | # `file_ext langType langString [langString..]`
3071 | #
3072 | # Example:
3073 | # `file_ext CPP .ch .cxx .cpp.in`
3074 | #
3075 | # langTypes are defined in uncrusify_types.h in the lang_flag_e enum, use
3076 | # them without the 'LANG_' prefix: 'LANG_CPP' => 'CPP'
3077 | #
3078 | #
3079 | # - Custom macro-based indentation can be set up using 'macro-open',
3080 | # 'macro-else' and 'macro-close'.
3081 | # `(macro-open | macro-else | macro-close) tokenString`
3082 | #
3083 | # Example:
3084 | # `macro-open BEGIN_TEMPLATE_MESSAGE_MAP`
3085 | # `macro-open BEGIN_MESSAGE_MAP`
3086 | # `macro-close END_MESSAGE_MAP`
3087 | #
3088 | #
3089 | # option(s) with 'not default' value: 0
3090 | #
3091 |
--------------------------------------------------------------------------------