Revert "[CHORE] Upgrade project to latest Xcode & Swift 5" by rafaelks · Pull Request #2690 · RocketChat/Rocket.Chat.iOS · GitHub
Skip to content
This repository was archived by the owner on Jun 7, 2020. It is now read-only.

Revert "[CHORE] Upgrade project to latest Xcode & Swift 5"#2690

Merged
rafaelks merged 1 commit into
developfrom
revert-2689-swift5
May 6, 2019
Merged

Revert "[CHORE] Upgrade project to latest Xcode & Swift 5"#2690
rafaelks merged 1 commit into
developfrom
revert-2689-swift5

Conversation

@rafaelks

@rafaelks rafaelks commented May 6, 2019

Copy link
Copy Markdown
Contributor

Reverts #2689

This merge started causing some weird bugs on the list of messages, will revert it for now.

@rafaelks rafaelks merged commit 0419fc7 into develop May 6, 2019

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 161 characters (line_length)


if let linkUrlString = self?.unescaped(string: linkUrlString), let url = URL(string: linkUrlString) ?? URL(string: linkUrlString.addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed) ?? linkUrlString) {
attributedString.addAttribute(NSAttributedString.Key.link, value: url, range: string().range(of: linkTextString))
attributedString.addAttribute(NSLinkAttributeName, value: url, range: string().range(of: linkTextString))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 121 characters (line_length)

leadFormattingBlock(attributedString, NSRange(location: match.range(at: 1).location, length: match.range(at: 2).location - match.range(at: 1).location), level)
let level = match.rangeAt(1).length
formattingBlock?(attributedString, match.rangeAt(2), level)
leadFormattingBlock(attributedString, NSRange(location: match.rangeAt(1).location, length: match.rangeAt(2).location - match.rangeAt(1).location), level)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 165 characters (line_length)

addItalicParsingWithFormattingBlock { attributedString, range in
attributedString.enumerateAttributes(in: range, options: []) { attributes, range, _ in
if let font = attributes[NSAttributedString.Key.font] as? UIFont, let boldFont = self.strongAttributes[NSAttributedString.Key.font] as? UIFont, font == boldFont {
if let font = attributes[NSFontAttributeName] as? UIFont, let boldFont = self.strongAttributes[NSFontAttributeName] as? UIFont, font == boldFont {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 166 characters (line_length)

addStrongParsingWithFormattingBlock { attributedString, range in
attributedString.enumerateAttributes(in: range, options: []) { attributes, range, _ in
if let font = attributes[NSAttributedString.Key.font] as? UIFont, let italicFont = self.italicAttributes[NSAttributedString.Key.font] as? UIFont, font == italicFont {
if let font = attributes[NSFontAttributeName] as? UIFont, let italicFont = self.italicAttributes[NSFontAttributeName] as? UIFont, font == italicFont {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 170 characters (line_length)

internal struct TableKey<T: Hashable>: Hashable {
@usableFromInline
internal let pointeeHashValue: Int
internal let hashValue: Int

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legacy Hashing Violation: Prefer using the hash(into:) function instead of overriding hashValue (legacy_hashing)

/// - Complexity: O(n)
@inlinable
init(source: Collection, target: Collection) {
public init(source: Collection, target: Collection) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cyclomatic Complexity Violation: Function should have complexity 10 or less: currently complexity equals 29 (cyclomatic_complexity)
Function Body Length Violation: Function body should span 40 lines or less excluding comments and whitespace: currently spans 160 lines (function_body_length)

/// - Complexity: O(n)
@inlinable
init(source: Collection, target: Collection, section: Int) {
public init(source: Collection, target: Collection, section: Int) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Body Length Violation: Function body should span 40 lines or less excluding comments and whitespace: currently spans 42 lines (function_body_length)

Comment thread Podfile
post_install do |installer|
swift42Targets = ['RCMarkdownParser', 'MobilePlayer']
swift3Targets = ['MobilePlayer', 'RCMarkdownParser']
swift42Targets = ['SwipeCellKit']

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming/VariableName: Use snake_case for variable names.

Comment thread Podfile

post_install do |installer|
swift42Targets = ['RCMarkdownParser', 'MobilePlayer']
swift3Targets = ['MobilePlayer', 'RCMarkdownParser']

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Naming/VariableName: Use snake_case for variable names.
Style/WordArray: Use %w or %W for an array of words.

parser.linkAttributes = [.foregroundColor: UIColor.darkGray]
parser.strongAttributes = [NSAttributedString.Key.font.rawValue: MessageTextFontAttributes.boldFont]
parser.italicAttributes = [NSAttributedString.Key.font.rawValue: MessageTextFontAttributes.italicFont]
parser.strikeAttributes = [NSAttributedString.Key.strikethroughStyle.rawValue: NSNumber(value: NSUnderlineStyle.single.rawValue)]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 137 characters (line_length)

var codeAttributes: [NSAttributedString.Key: Any] = [.backgroundColor: attributes.codeBackgroundColor]
codeAttributes[.foregroundColor] = attributes.codeTextColor
codeAttributes[.font] = MessageTextFontAttributes.monoSpacedFont
var codeAttributes: [String: Any] = [NSAttributedString.Key.backgroundColor.rawValue: attributes.codeBackgroundColor]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 125 characters (line_length)

switch gesture.state {
case .began:
if let swipeable = scrollView?.swipeables.first(where: { $0.state == .dragging }) as? UIView, self.swipeable != nil, swipeable != self.swipeable! {
if let swipeable = scrollView?.swipeables.first(where: { $0.state == .dragging }) as? UIView, swipeable != self.swipeable {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 135 characters (line_length)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line Length Violation: Line should be 120 characters or less: currently 135 characters (line_length)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants