Skip to content

Commit

Permalink
Fix method declarations, remove if statement fixer regex
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-hofsteede committed Nov 18, 2013
1 parent a7e4aa6 commit 8a36d06
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion HelloMixpanel/HelloMixpanelTests/HelloMixpanelTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ - (void)tearDown
self.mixpanel = nil;
}

- (void) setupHTTPServer
- (void)setupHTTPServer
{
if (!self.httpServer) {
self.httpServer = [[HTTPServer alloc] init];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@

@interface MixpanelDummyHTTPConnection : HTTPConnection

+(int) getRequestCount;
+ (int)getRequestCount;

@end
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ + (void)initialize
requestCount = 0;
}

+(int) getRequestCount
+ (int)getRequestCount
{
return requestCount;
}
Expand All @@ -29,7 +29,7 @@ +(int) getRequestCount
return [[HTTPDataResponse alloc] initWithData:[@"1" dataUsingEncoding:NSUTF8StringEncoding]];
}

- (BOOL) supportsMethod:(NSString *)method atPath:(NSString *)path
- (BOOL)supportsMethod:(NSString *)method atPath:(NSString *)path
{
return [super supportsMethod:method atPath:path] || [method isEqualToString:@"POST"];
}
Expand Down
4 changes: 2 additions & 2 deletions Mixpanel/MPSurveyQuestionViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
return cell;
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
MPSurveyTableViewCell *cell = (MPSurveyTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
if (!cell.isChecked) {
Expand All @@ -286,7 +286,7 @@ -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *
}
}

-(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
{
MPSurveyTableViewCell *cell = (MPSurveyTableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
if (cell.isChecked) {
Expand Down
3 changes: 1 addition & 2 deletions fix_syntax.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
lambda m: '%s\n\n' % m.groups(1)), #add blank lines after interface or implementation declarations (except where the interface line ends in a '{')
(r'(?<=[^\n])\n@end', lambda m: '\n\n@end' ), #add blank lines before @end
(r'for[ ]*\((.*)\)\s*{\n', lambda m: 'for (%s) {\n' % m.group(1)), #correct spacing for for loops
(r'if[ ]*\((.*)\)\s*{\n', lambda m: 'if (%s) {\n' % m.group(1)), #correct spacing for if statements
(r'}\s*else\s*{', '} else {'), #correct spacing for if statements
(r'}\s*else\s*{', '} else {'), #correct spacing for else statements
(r'for \([ ]*uint[ ]+', 'for (NSUInteger '), #use NSUinteger instead of uint
(r'for \([ ]*int[ ]+', 'for (NSInteger '), #use NSinteger instead of int
(r'\n([+-])[ ]*\((\w+\s*\*?)\)\s*', lambda m: '\n%s (%s)' % (m.group(1), m.group(2))), #proper spacing in method definitions
Expand Down

0 comments on commit 8a36d06

Please sign in to comment.