Skip to content

Commit

Permalink
Fixed various project warnings. Completely disabled nullability check…
Browse files Browse the repository at this point in the history
…s, went down from ~20k to 195.
  • Loading branch information
stefanceriu committed Feb 10, 2022
1 parent 850cad4 commit 4bd5c12
Show file tree
Hide file tree
Showing 85 changed files with 465 additions and 679 deletions.
2 changes: 1 addition & 1 deletion .swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ line_length:
error: 1000

file_length:
warning: 700
warning: 800
error: 1000

type_body_length:
Expand Down
2 changes: 0 additions & 2 deletions Config/BuildSettings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ final class BuildSettings: NSObject {
static let stunServerFallbackUrlString: String? = "stun:turn.matrix.org"

// MARK: - Public rooms Directory
#warning("Unused build setting: should this be implemented in ShowDirectory?")
static let publicRoomsAllowServerChange: Bool = true
// List of homeservers for the public rooms directory
static let publicRoomsDirectoryServers = [
"matrix.org",
Expand Down
4 changes: 4 additions & 0 deletions Config/Project-Warnings.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@ GCC_WARN_UNDECLARED_SELECTOR = YES
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE
GCC_WARN_UNUSED_FUNCTION = YES
GCC_WARN_UNUSED_VARIABLE = YES

WARNING_CFLAGS = $(inherited) -Wno-nullability-completeness;
OTHER_SWIFT_FLAGS = $(inherited) -Xcc -Wno-nullability-completeness

7 changes: 5 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ end
########################################

def import_MatrixKit_pods
pod 'HPGrowingTextView', '~> 1.1'
pod 'libPhoneNumber-iOS', '~> 0.9.13'
pod 'DTCoreText', '~> 1.6.25'
#pod 'DTCoreText/Extension', '~> 1.6.25'
Expand Down Expand Up @@ -98,7 +97,7 @@ abstract_target 'RiotPods' do
pod 'DSWaveformImage', '~> 6.1.1'
pod 'ffmpeg-kit-ios-audio', '4.5.1'

pod 'FLEX', '~> 4.5.0', :configurations => ['Debug']
pod 'FLEX', '~> 4.5.0', :configurations => ['Debug'], :inhibit_warnings => true

target 'RiotTests' do
inherit! :search_paths
Expand Down Expand Up @@ -149,6 +148,10 @@ post_install do |installer|

# Stop Xcode 12 complaining about old IPHONEOS_DEPLOYMENT_TARGET from pods
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'

# Disable nullability checks
config.build_settings['WARNING_CFLAGS'] ||= ['$(inherited)','-Wno-nullability-completeness']
config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['$(inherited)', '-Xcc', '-Wno-nullability-completeness']
end
end
end
48 changes: 2 additions & 46 deletions Riot/Assets/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="18122" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="H1p-Uh-vWS">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="19529" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="H1p-Uh-vWS">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="18093"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="19519"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
Expand Down Expand Up @@ -46,24 +46,6 @@
</objects>
<point key="canvasLocation" x="-153" y="-419"/>
</scene>
<!--Room Member Details View Controller-->
<scene sceneID="eq5-qi-gDd">
<objects>
<viewController id="nDS-pp-sWM" customClass="RoomMemberDetailsViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="AgI-3V-llt"/>
<viewControllerLayoutGuide type="bottom" id="6ie-9b-cBo"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="N8z-LO-417">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="e8Z-uW-oDv" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="5047" y="-1437"/>
</scene>
<!--Room Search View Controller-->
<scene sceneID="rUg-1s-vHX">
<objects>
Expand Down Expand Up @@ -116,14 +98,6 @@
</objects>
<point key="canvasLocation" x="2558" y="180"/>
</scene>
<!--Segmented View Controller-->
<scene sceneID="NZu-Q0-P0z">
<objects>
<tableViewController id="e7G-NU-7ck" customClass="SegmentedViewController" sceneMemberID="viewController"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="fXh-hO-Zgf" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="3326" y="-442"/>
</scene>
<!--People View Controller-->
<scene sceneID="Qba-PP-lco">
<objects>
Expand Down Expand Up @@ -501,24 +475,6 @@
</objects>
<point key="canvasLocation" x="1385" y="180"/>
</scene>
<!--Contacts Table View Controller-->
<scene sceneID="2zi-xJ-RQo">
<objects>
<viewController id="udm-55-AMb" customClass="ContactsTableViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Jch-ZS-1Mm"/>
<viewControllerLayoutGuide type="bottom" id="7q1-ig-sPp"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="6G9-nj-ktC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="uv3-zI-b3q" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="374" y="449"/>
</scene>
<!--Thread-->
<scene sceneID="Opl-gU-pwm">
<objects>
Expand Down
2 changes: 1 addition & 1 deletion Riot/Managers/BugReport/RageShakeManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ - (UIImage*)takeScreenshot {

UIImage *image;

AppDelegate* theDelegate = [AppDelegate theDelegate];
LegacyAppDelegate* theDelegate = [AppDelegate theDelegate];
UIGraphicsBeginImageContextWithOptions(theDelegate.window.bounds.size, NO, [UIScreen mainScreen].scale);

// Iterate over every window from back to front
Expand Down
1 change: 0 additions & 1 deletion Riot/Managers/PushNotification/PushNotificationService.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ NS_ASSUME_NONNULL_BEGIN
@param pushNotificationService PushNotificationService object.
@param roomId Room identifier to be navigated.
@param eventId Event identifier to be navigated around.
*/
- (void)pushNotificationService:(PushNotificationService *)pushNotificationService
shouldNavigateToRoomWithId:(NSString *)roomId;
Expand Down
4 changes: 3 additions & 1 deletion Riot/Managers/Widgets/WidgetManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,6 @@ - (MXHTTPOperation *)closeWidget:(NSString *)widgetId inRoom:(MXRoom *)room succ
Check user's power for widgets management in a room.
@param room the room to check.
@return an NSError if the user cannot act on widgets in this room. Else, nil.
*/
- (void)checkWidgetPermissionInRoom:(MXRoom *)room success:(dispatch_block_t)success failure:(void (^)(NSError *))failure
{
Expand Down Expand Up @@ -742,6 +741,8 @@ - (NSString *)scalarTokenForMXSession:(MXSession *)mxSession
return configs[mxSession.myUser.userId].scalarToken;
}

#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
- (void)loadConfigs
{
NSUserDefaults *userDefaults = [MXKAppSettings standardAppSettings].sharedUserDefaults;
Expand Down Expand Up @@ -787,6 +788,7 @@ - (void)saveConfigs
[userDefaults setObject:[NSKeyedArchiver archivedDataWithRootObject:configs]
forKey:@"integrationManagerConfigs"];
}
#pragma clang diagnostic pop


#pragma mark - Errors
Expand Down
Loading

0 comments on commit 4bd5c12

Please sign in to comment.