Fix a few more SwiftLint errors

This commit is contained in:
Marc Rousavy 2021-02-25 14:05:20 +01:00
parent d05525ad01
commit 4d7b8a01f5
3 changed files with 8 additions and 1 deletions

View File

@ -3,6 +3,8 @@ disabled_rules:
- trailing_comma
- todo
- type_body_length
- cyclomatic_complexity
- function_body_length
opt_in_rules: # some rules are turned off by default, so you need to opt-in
- empty_count # Find all the available rules by running: `swiftlint rules`
@ -11,6 +13,7 @@ excluded: # paths to ignore during linting. Takes precedence over `included`.
# Adjust rule numbers
line_length: 160
file_length: 500
# reporter type (xcode, json, csv, checkstyle, codeclimate, junit, html, emoji, sonarqube, markdown, github-actions-logging)
reporter: "xcode"

View File

@ -37,7 +37,10 @@ extension CameraView: AVCaptureMetadataOutputObjectsDelegate {
private func invokeOnCodeScanned(codes: [[String: Any]?]) {
guard let onCodeScanned = self.onCodeScanned else {
ReactLogger.log(level: .warning, message: "onCodeScanned was invoked with no listeners. This means that the Camera is unnecessarily scanning codes. This indicates a memory leak.", alsoLogToJS: true)
ReactLogger.log(level: .warning,
message: "onCodeScanned was invoked with no listeners. " +
"This means that the Camera is unnecessarily scanning codes. This indicates a memory leak.",
alsoLogToJS: true)
return
}
onCodeScanned(["codes": codes])

View File

@ -25,6 +25,7 @@ import UIKit
// CameraView+TakePhoto
// TODO: Photo HDR
// swiftlint:disable line_length
private let propsThatRequireReconfiguration = ["cameraId", "enableDepthData", "enableHighResolutionCapture", "enablePortraitEffectsMatteDelivery", "preset", "onCodeScanned", "scannableCodes"]
private let propsThatRequireDeviceReconfiguration = ["fps", "hdr", "lowLightBoost", "colorSpace"]