Skip to content

Commit

Permalink
chore: formating code (#4340)
Browse files Browse the repository at this point in the history
  • Loading branch information
brustolin authored Sep 17, 2024
1 parent e02eb74 commit 888a145
Show file tree
Hide file tree
Showing 181 changed files with 307 additions and 479 deletions.
3 changes: 1 addition & 2 deletions Samples/iOS-ObjectiveC/iOS-ObjectiveC/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

#import "iOS_ObjectiveC-Swift.h"

@interface
AppDelegate ()
@interface AppDelegate ()
@end

@implementation AppDelegate
Expand Down
3 changes: 1 addition & 2 deletions Samples/iOS-ObjectiveC/iOS-ObjectiveC/ViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

@import Sentry;

@interface
ViewController ()
@interface ViewController ()

@end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ NS_ASSUME_NONNULL_BEGIN
* have started the launch profiler by the time this runs. This must be done in Objective-C because
* Swift does not allow implementation of `NSObject.load()`.
*/
@interface
NSObject (SentryAppSetup)
@interface NSObject (SentryAppSetup)
@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#import "NSObject+SentryAppSetup.h"

@implementation
NSObject (SentryAppSetup)
@implementation NSObject (SentryAppSetup)
+ (void)load
{
NSLog(@"[iOS-Swift] Starting app launch work");
Expand Down
2 changes: 1 addition & 1 deletion Samples/iOS-Swift/iOS-Swift/Tools/SentryBenchmarking.mm
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ + (NSString *)stopBenchmark
= ((NSNumber *)[userTimeTotals.allValues valueForKeyPath:@"@sum.self"]).integerValue;

return [NSString stringWithFormat:@"%ld,%ld,%ld,%ld", profilerSystemTime, profilerUserTime,
appSystemTime, appUserTime];
appSystemTime, appUserTime];
}

@end
3 changes: 1 addition & 2 deletions SentryTestUtils/SentryFileManager+Test.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ NS_ASSUME_NONNULL_BEGIN
SENTRY_EXTERN NSURL *launchProfileConfigFileURL(void);
SENTRY_EXTERN NSURL *_Nullable sentryLaunchConfigFileURL;

@interface
SentryFileManager ()
@interface SentryFileManager ()

@property (nonatomic, copy) NSString *eventsPath;
@property (nonatomic, copy) NSString *envelopesPath;
Expand Down
3 changes: 1 addition & 2 deletions SentryTestUtils/SentryHub+Test.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
NS_ASSUME_NONNULL_BEGIN

/** Expose the internal test init for testing. */
@interface
SentryHub ()
@interface SentryHub ()

- (instancetype)initWithClient:(SentryClient *_Nullable)client
andScope:(SentryScope *_Nullable)scope
Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/Profiling/SentryProfilerState.mm
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ - (void)appendBacktrace:(const Backtrace &)backtrace

const auto stack = [NSMutableArray<NSNumber *> array];
for (std::vector<uintptr_t>::size_type backtraceAddressIdx = 0;
backtraceAddressIdx < backtrace.addresses.size(); backtraceAddressIdx++) {
backtraceAddressIdx < backtrace.addresses.size(); backtraceAddressIdx++) {
const auto instructionAddress
= sentry_formatHexAddressUInt64(backtrace.addresses[backtraceAddressIdx]);
const auto frameIndex = state.frameIndexLookup[instructionAddress];
Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/Profiling/SentryProfilerTestHelpers.m
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
NSUInteger numberOfProfiles = [contents count];
NSString *pathToWrite = [testProfileDirPath
stringByAppendingPathComponent:[NSString stringWithFormat:@"profile%lld",
(long long)numberOfProfiles]];
(long long)numberOfProfiles]];

if ([fm fileExistsAtPath:pathToWrite]) {
SENTRY_LOG_DEBUG(@"Already a profile file present; make sure to remove them right after "
Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryANRTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ typedef NS_ENUM(NSInteger, SentryANRTrackerState) {
kSentryANRTrackerStopping
};

@interface
SentryANRTracker ()
@interface SentryANRTracker ()

@property (nonatomic, strong) SentryCrashWrapper *crashWrapper;
@property (nonatomic, strong) SentryDispatchQueueWrapper *dispatchQueueWrapper;
Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryANRTrackerV2.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ typedef NS_ENUM(NSInteger, SentryANRTrackerState) {
kSentryANRTrackerStopping
};

@interface
SentryANRTrackerV2 ()
@interface SentryANRTrackerV2 ()

@property (nonatomic, strong) SentryCrashWrapper *crashWrapper;
@property (nonatomic, strong) SentryDispatchQueueWrapper *dispatchQueueWrapper;
Expand Down
5 changes: 2 additions & 3 deletions Sources/Sentry/SentryANRTrackingIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface
SentryANRTrackingIntegration ()
@interface SentryANRTrackingIntegration ()

@property (nonatomic, strong) SentryANRTracker *tracker;
@property (nonatomic, strong) SentryOptions *options;
Expand Down Expand Up @@ -102,7 +101,7 @@ - (void)anrDetected
}

NSString *message = [NSString stringWithFormat:@"App hanging for at least %li ms.",
(long)(self.options.appHangTimeoutInterval * 1000)];
(long)(self.options.appHangTimeoutInterval * 1000)];
SentryEvent *event = [[SentryEvent alloc] initWithLevel:kSentryLevelError];
SentryException *sentryException =
[[SentryException alloc] initWithValue:message type:SentryANRExceptionType];
Expand Down
5 changes: 2 additions & 3 deletions Sources/Sentry/SentryANRTrackingIntegrationV2.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface
SentryANRTrackingIntegrationV2 ()
@interface SentryANRTrackingIntegrationV2 ()

@property (nonatomic, strong) SentryANRTrackerV2 *tracker;
@property (nonatomic, strong) SentryOptions *options;
Expand Down Expand Up @@ -101,7 +100,7 @@ - (void)anrDetectedWithType:(enum SentryANRType)type
}

NSString *message = [NSString stringWithFormat:@"App hanging for at least %li ms.",
(long)(self.options.appHangTimeoutInterval * 1000)];
(long)(self.options.appHangTimeoutInterval * 1000)];
SentryEvent *event = [[SentryEvent alloc] initWithLevel:kSentryLevelError];
SentryException *sentryException =
[[SentryException alloc] initWithValue:message type:SentryANRExceptionTypeV2];
Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryAppStartTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
*/
static const NSTimeInterval SENTRY_APP_START_MAX_DURATION = 180.0;

@interface
SentryAppStartTracker () <SentryFramesTrackerListener>
@interface SentryAppStartTracker () <SentryFramesTrackerListener>

@property (nonatomic, strong) SentryAppState *previousAppState;
@property (nonatomic, strong) SentryDispatchQueueWrapper *dispatchQueue;
Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryAppStartTrackingIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
# import <SentryDependencyContainer.h>
# import <SentryDispatchQueueWrapper.h>

@interface
SentryAppStartTrackingIntegration ()
@interface SentryAppStartTrackingIntegration ()

@property (nonatomic, strong) SentryAppStartTracker *tracker;

Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryAppStateManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
# import <UIKit/UIKit.h>
#endif

@interface
SentryAppStateManager ()
@interface SentryAppStateManager ()

@property (nonatomic, strong) SentryOptions *options;
@property (nonatomic, strong) SentryCrashWrapper *crashWrapper;
Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryAsynchronousOperation.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface
SentryAsynchronousOperation ()
@interface SentryAsynchronousOperation ()

@property (nonatomic, getter=isCancelled, readwrite) BOOL cancelled;
@property (nonatomic, getter=isFinished, readwrite) BOOL finished;
Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryAutoBreadcrumbTrackingIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface
SentryAutoBreadcrumbTrackingIntegration ()
@interface SentryAutoBreadcrumbTrackingIntegration ()

@property (nonatomic, strong) SentryBreadcrumbTracker *breadcrumbTracker;

Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryAutoSessionTrackingIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface
SentryAutoSessionTrackingIntegration ()
@interface SentryAutoSessionTrackingIntegration ()

@property (nonatomic, strong) SentrySessionTracker *tracker;

Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryBinaryImageCache.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
@implementation SentryBinaryImageInfo
@end

@interface
SentryBinaryImageCache ()
@interface SentryBinaryImageCache ()
@property (nonatomic, strong) NSMutableArray<SentryBinaryImageInfo *> *cache;
- (void)binaryImageAdded:(const SentryCrashBinaryImage *)image;
- (void)binaryImageRemoved:(const SentryCrashBinaryImage *)image;
Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryBreadcrumb.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
#import "SentryNSDictionarySanitize.h"
#import "SentrySwift.h"

@interface
SentryBreadcrumb ()
@interface SentryBreadcrumb ()
@property (atomic, strong) NSDictionary<NSString *, id> *_Nullable unknown;
@end

Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryBreadcrumbTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
static NSString *const SentryBreadcrumbTrackerSwizzleSendAction
= @"SentryBreadcrumbTrackerSwizzleSendAction";

@interface
SentryBreadcrumbTracker ()
@interface SentryBreadcrumbTracker ()
#if SENTRY_HAS_REACHABILITY
<SentryReachabilityObserver>
#endif // !TARGET_OS_WATCH
Expand Down
2 changes: 1 addition & 1 deletion Sources/Sentry/SentryByteCountFormatter.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ + (NSString *)bytesCountDescription:(unsigned long)bytes
[formatter setPositiveFormat:@"#,##0"];

return [NSString stringWithFormat:@"%@ %@",
[formatter stringFromNumber:[NSNumber numberWithDouble:result]], units[index]];
[formatter stringFromNumber:[NSNumber numberWithDouble:result]], units[index]];
}

@end
5 changes: 2 additions & 3 deletions Sources/Sentry/SentryClient.m
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface
SentryClient ()
@interface SentryClient ()

@property (nonatomic, strong) SentryTransportAdapter *transportAdapter;
@property (nonatomic, strong) SentryDebugImageProvider *debugImageProvider;
Expand Down Expand Up @@ -985,7 +984,7 @@ - (void)applyCurrentViewNamesToEventContext:(SentryEvent *)event withScope:(Sent
app[@"view_names"] = @[ scope.currentScreen ];
} else {
app[@"view_names"] = [SentryDependencyContainer.sharedInstance
.application relevantViewControllersNames];
.application relevantViewControllersNames];
}
}
}];
Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryConcurrentRateLimitsDictionary.m
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#import "SentryConcurrentRateLimitsDictionary.h"
#import <Foundation/Foundation.h>

@interface
SentryConcurrentRateLimitsDictionary ()
@interface SentryConcurrentRateLimitsDictionary ()

/* Key is the type and value is valid until date */
@property (nonatomic, strong) NSMutableDictionary<NSNumber *, NSDate *> *rateLimits;
Expand Down
6 changes: 3 additions & 3 deletions Sources/Sentry/SentryCoreDataTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ - (NSString *)descriptionForOperations:
if (items && items.count > 0) {
if (items.count == 1) {
[resultParts addObject:[NSString stringWithFormat:@"%@ %@ '%@'", op,
items.allValues[0], items.allKeys[0]]];
items.allValues[0], items.allKeys[0]]];
} else {
[resultParts addObject:[NSString stringWithFormat:@"%@ %lu items", op,
(unsigned long)total]];
(unsigned long)total]];
}
}
};
Expand Down Expand Up @@ -197,7 +197,7 @@ - (NSString *)descriptionFromRequest:(NSFetchRequest *)request

if (request.predicate) {
[result appendFormat:@" WHERE %@",
[predicateDescriptor predicateDescription:request.predicate]];
[predicateDescriptor predicateDescription:request.predicate]];
}

if (request.sortDescriptors.count > 0) {
Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryCoreDataTrackingIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
#import "SentryOptions.h"
#import "SentryThreadInspector.h"

@interface
SentryCoreDataTrackingIntegration ()
@interface SentryCoreDataTrackingIntegration ()

@property (nonatomic, strong) SentryCoreDataTracker *tracker;

Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryCrashInstallationReporter.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface
SentryCrashInstallationReporter ()
@interface SentryCrashInstallationReporter ()

@property (nonatomic, strong) SentryInAppLogic *inAppLogic;
@property (nonatomic, strong) SentryCrashWrapper *crashWrapper;
Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryCrashIntegration.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
static NSString *const DEVICE_KEY = @"device";
static NSString *const LOCALE_KEY = @"locale";

@interface
SentryCrashIntegration ()
@interface SentryCrashIntegration ()

@property (nonatomic, weak) SentryOptions *options;
@property (nonatomic, strong) SentryDispatchQueueWrapper *dispatchQueueWrapper;
Expand Down
26 changes: 12 additions & 14 deletions Sources/Sentry/SentryCrashReportConverter.m
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
#import "SentryThread.h"
#import "SentryUser.h"

@interface
SentryCrashReportConverter ()
@interface SentryCrashReportConverter ()

@property (nonatomic, strong) NSDictionary *report;
@property (nonatomic, assign) NSInteger crashedThreadIndex;
Expand Down Expand Up @@ -132,7 +131,7 @@ - (SentryEvent *_Nullable)convertReportToEvent
&& appContext[@"app_build"]) {
event.releaseName =
[NSString stringWithFormat:@"%@@%@+%@", appContext[@"app_identifier"],
appContext[@"app_version"], appContext[@"app_build"]];
appContext[@"app_version"], appContext[@"app_build"]];
}

if (nil == event.dist && appContext[@"app_build"]) {
Expand Down Expand Up @@ -369,16 +368,16 @@ - (SentryDebugMeta *)debugMetaFromBinaryImageDictionary:(NSDictionary *)sourceIm
} else if ([exceptionType isEqualToString:@"mach"]) {
exception = [[SentryException alloc]
initWithValue:[NSString stringWithFormat:@"Exception %@, Code %@, Subcode %@",
self.exceptionContext[@"mach"][@"exception"],
self.exceptionContext[@"mach"][@"code"],
self.exceptionContext[@"mach"][@"subcode"]]
self.exceptionContext[@"mach"][@"exception"],
self.exceptionContext[@"mach"][@"code"],
self.exceptionContext[@"mach"][@"subcode"]]
type:self.exceptionContext[@"mach"][@"exception_name"]];
} else if ([exceptionType isEqualToString:@"signal"]) {
exception = [[SentryException alloc]
initWithValue:[NSString stringWithFormat:@"Signal %@, Code %@",
self.exceptionContext[@"signal"][@"signal"],
self.exceptionContext[@"signal"][@"code"]]
type:self.exceptionContext[@"signal"][@"name"]];
exception =
[[SentryException alloc] initWithValue:[NSString stringWithFormat:@"Signal %@, Code %@",
self.exceptionContext[@"signal"][@"signal"],
self.exceptionContext[@"signal"][@"code"]]
type:self.exceptionContext[@"signal"][@"name"]];
} else if ([exceptionType isEqualToString:@"user"]) {
NSString *exceptionReason =
[NSString stringWithFormat:@"%@", self.exceptionContext[@"reason"]];
Expand Down Expand Up @@ -451,9 +450,8 @@ - (void)enhanceValueFromNotableAddresses:(SentryException *)exception
}
}
if (reasons.count > 0) {
exception.value =
[[[reasons array] sortedArrayUsingSelector:@selector(localizedCaseInsensitiveCompare:)]
componentsJoinedByString:@" > "];
exception.value = [[[reasons array] sortedArrayUsingSelector:@selector
(localizedCaseInsensitiveCompare:)] componentsJoinedByString:@" > "];
}
}

Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryCrashReportSink.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
static const NSTimeInterval SENTRY_APP_START_CRASH_DURATION_THRESHOLD = 2.0;
static const NSTimeInterval SENTRY_APP_START_CRASH_FLUSH_DURATION = 5.0;

@interface
SentryCrashReportSink ()
@interface SentryCrashReportSink ()

@property (nonatomic, strong) SentryInAppLogic *inAppLogic;
@property (nonatomic, strong) SentryCrashWrapper *crashWrapper;
Expand Down
3 changes: 1 addition & 2 deletions Sources/Sentry/SentryCrashStackEntryMapper.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

NS_ASSUME_NONNULL_BEGIN

@interface
SentryCrashStackEntryMapper ()
@interface SentryCrashStackEntryMapper ()

@property (nonatomic, strong) SentryInAppLogic *inAppLogic;

Expand Down
Loading

0 comments on commit 888a145

Please sign in to comment.