Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Aligning all pointer stars #103

Merged
merged 2 commits into from

2 participants

@tonyarnold

The pointer stars were aligned inconsistently throughout the default templates. They have been aligned hard against the variable name or closing bracket, with a preceding space.

Happy to change this to whatever style you prefer @rentzsch, but my OCD side won't let this slide in templates I use everywhere.

@tonyarnold tonyarnold Aligning all pointer stars
The pointer stars were aligned inconsistently throughout the default
templates. They have been aligned hard against the variable name or
closing bracket, with a preceding space.
3c5fd87
@rentzsch
Owner

Yes, consistency is currently a mess, especially with generated @property vs method return types. I like my asterisks next to the (i)var name, unless it's standalone (like in return types or inside method param parens). This example may help: https://github.com/rentzsch/JRTruthTable/blob/master/JRTruthTable.h

@tonyarnold

Thanks, @rentzsch, I'll take those comments and roll them in to this pull request later today.

@rentzsch rentzsch merged commit 8d4c609 into rentzsch:master
@rentzsch
Owner

Pulled, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 16, 2012
  1. @tonyarnold

    Aligning all pointer stars

    tonyarnold authored
    The pointer stars were aligned inconsistently throughout the default
    templates. They have been aligned hard against the variable name or
    closing bracket, with a preceding space.
Commits on Apr 17, 2012
  1. @tonyarnold
This page is out of date. Refresh to see the latest.
Showing with 14 additions and 14 deletions.
  1. +5 −5 templates/machine.h.motemplate
  2. +9 −9 templates/machine.m.motemplate
View
10 templates/machine.h.motemplate
@@ -47,16 +47,16 @@ extern const struct <$managedObjectClassName$>FetchedProperties {<$foreach Fetch
<$foreach Relationship noninheritedRelationships do$>
<$if Relationship.isToMany$>
<$if TemplateVar.arc$>
-@property (nonatomic, strong) <$Relationship.immutableCollectionClassName$>* <$Relationship.name$>;
+@property (nonatomic, strong) <$Relationship.immutableCollectionClassName$> *<$Relationship.name$>;
<$else$>
-@property (nonatomic, retain) <$Relationship.immutableCollectionClassName$>* <$Relationship.name$>;
+@property (nonatomic, retain) <$Relationship.immutableCollectionClassName$> *<$Relationship.name$>;
<$endif$>
- (<$Relationship.mutableCollectionClassName$>*)<$Relationship.name$>Set;
<$else$>
<$if TemplateVar.arc$>
-@property (nonatomic, strong) <$Relationship.destinationEntity.managedObjectClassName$>* <$Relationship.name$>;
+@property (nonatomic, strong) <$Relationship.destinationEntity.managedObjectClassName$> *<$Relationship.name$>;
<$else$>
-@property (nonatomic, retain) <$Relationship.destinationEntity.managedObjectClassName$>* <$Relationship.name$>;
+@property (nonatomic, retain) <$Relationship.destinationEntity.managedObjectClassName$> *<$Relationship.name$>;
<$endif$>
//- (BOOL)validate<$Relationship.name.initialCapitalString$>:(id*)value_ error:(NSError**)error_;
<$endif$>
@@ -77,7 +77,7 @@ extern const struct <$managedObjectClassName$>FetchedProperties {<$foreach Fetch
#if TARGET_OS_IPHONE
<$foreach Relationship noninheritedRelationships do$>
<$if Relationship.isToMany$>
-- (NSFetchedResultsController *)new<$Relationship.name.initialCapitalString$>FetchedResultsControllerWithSortDescriptors:(NSArray *)sortDescriptors;
+- (NSFetchedResultsController*)new<$Relationship.name.initialCapitalString$>FetchedResultsControllerWithSortDescriptors:(NSArray*)sortDescriptors;
<$endif$>
<$endforeach do$>
#endif
View
18 templates/machine.m.motemplate
@@ -38,7 +38,7 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
return (<$managedObjectClassName$>ID*)[super objectID];
}
-+ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key {
++ (NSSet*)keyPathsForValuesAffectingValueForKey:(NSString*)key {
NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key];
<$foreach Attribute noninheritedAttributes do$><$if Attribute.hasDefinedAttributeType$><$if Attribute.hasScalarAttributeType$>
if ([key isEqualToString:@"<$Attribute.name$>Value"]) {
@@ -115,7 +115,7 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
+ (id)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>error:(NSError**)error_ {
NSParameterAssert(moc_);
NSError *error = nil;
-
+
NSManagedObjectModel *model = [[moc_ persistentStoreCoordinator] managedObjectModel];
<$if FetchRequest.hasBindings$>
NSDictionary *substitutionVariables = [NSDictionary dictionaryWithObjectsAndKeys:
@@ -129,10 +129,10 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
NSFetchRequest *fetchRequest = [model fetchRequestFromTemplateWithName:@"<$FetchRequest.name$>"
substitutionVariables:substitutionVariables];
NSAssert(fetchRequest, @"Can't find fetch request named \"<$FetchRequest.name$>\".");
-
+
id result = nil;
NSArray *results = [moc_ executeFetchRequest:fetchRequest error:&error];
-
+
if (!error) {
switch ([results count]) {
case 0:
@@ -148,7 +148,7 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
results);
}
}
-
+
if (error_) *error_ = error;
return result;
}
@@ -168,7 +168,7 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
+ (NSArray*)fetch<$FetchRequest.name.initialCapitalString$>:(NSManagedObjectContext*)moc_ <$foreach Binding FetchRequest.bindings do2$><$Binding.name$>:(<$Binding.type$>)<$Binding.name$>_ <$endforeach do2$>error:(NSError**)error_ {
NSParameterAssert(moc_);
NSError *error = nil;
-
+
NSManagedObjectModel *model = [[moc_ persistentStoreCoordinator] managedObjectModel];
<$if FetchRequest.hasBindings$>
NSDictionary *substitutionVariables = [NSDictionary dictionaryWithObjectsAndKeys:
@@ -178,11 +178,11 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
nil];
<$else$>
NSDictionary *substitutionVariables = [NSDictionary dictionary];
- <$endif$>
+ <$endif$>
NSFetchRequest *fetchRequest = [model fetchRequestFromTemplateWithName:@"<$FetchRequest.name$>"
substitutionVariables:substitutionVariables];
NSAssert(fetchRequest, @"Can't find fetch request named \"<$FetchRequest.name$>\".");
-
+
NSArray *result = [moc_ executeFetchRequest:fetchRequest error:&error];
if (error_) *error_ = error;
return result;
@@ -193,7 +193,7 @@ const struct <$managedObjectClassName$>FetchedProperties <$managedObjectClassNam
#if TARGET_OS_IPHONE
<$foreach Relationship noninheritedRelationships do$>
<$if Relationship.isToMany$>
-- (NSFetchedResultsController *)new<$Relationship.name.initialCapitalString$>FetchedResultsControllerWithSortDescriptors:(NSArray *)sortDescriptors {
+- (NSFetchedResultsController*)new<$Relationship.name.initialCapitalString$>FetchedResultsControllerWithSortDescriptors:(NSArray*)sortDescriptors {
NSFetchRequest *fetchRequest = [NSFetchRequest new];
<$if !TemplateVar.arc$>[fetchRequest autorelease];<$endif$>
fetchRequest.entity = [NSEntityDescription entityForName:@"<$Relationship.destinationEntity.name$>" inManagedObjectContext:self.managedObjectContext];
Something went wrong with that request. Please try again.