diff --git a/.swiftlint.yml b/.swiftlint.yml deleted file mode 120000 index 7471365c..00000000 --- a/.swiftlint.yml +++ /dev/null @@ -1 +0,0 @@ -./Example/.swiftlint.yml \ No newline at end of file diff --git a/.swiftlint.yml b/.swiftlint.yml new file mode 100644 index 00000000..2e784982 --- /dev/null +++ b/.swiftlint.yml @@ -0,0 +1,73 @@ +disabled_rules: # rule identifiers to exclude from running + - colon + - comma + - control_statement + - nesting +opt_in_rules: # some rules are only opt-in + - empty_count + # Find all the available rules by running: + # swiftlint rules +included: # paths to include during linting. `--path` is ignored if present. + - Example + - RouteComposer +excluded: # paths to ignore during linting. Takes precedence over `included`. + - Carthage + - Pods + - Source/ExcludedFolder + - Source/ExcludedFile.swift + - Source/*/ExcludedFile.swift # Exclude files with a wildcard + +# configurable rules can be customized from this configuration file +# binary rules can set their severity level +force_cast: warning # implicitly +force_try: + severity: warning # explicitly +# rules that have both warning and error levels, can set just the warning level +# implicitly +line_length: 180 + +# they can set both implicitly with an array +type_body_length: + - 400 # warning + - 500 # error + +function_body_length: + - 150 # warning + - 200 # error + +cyclomatic_complexity: + - 15 # warning + - 25 # error + + +# or they can set both explicitly +file_length: + warning: 500 + error: 1200 + +# naming rules can set warnings/errors for min_length and max_length +# additionally they can set excluded names +type_name: + min_length: 4 # only warning + max_length: # warning and error + warning: 40 + error: 50 + excluded: iPhone # excluded via string + +identifier_name: + min_length: # only min_length + error: 3 # only error + excluded: # excluded via string array + - id + - vc + - key + - url + - URL + - GlobalAPIKey + +function_parameter_count: 6 + +large_tuple: + - 4 + - 10 +reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji, sonarqube) \ No newline at end of file diff --git a/ChatLayout.podspec b/ChatLayout.podspec index b6a3d44f..1bb9a53d 100644 --- a/ChatLayout.podspec +++ b/ChatLayout.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'ChatLayout' - s.version = '1.0.0' + s.version = '0.6.3' s.summary = 'Chat UI Library. An alternative solution to MessageKit. It uses custom UICollectionViewLayout to provide you full control over the presentation.' s.swift_version = '5.2' diff --git a/ChatLayout/Classes/Core/Model/StateController.swift b/ChatLayout/Classes/Core/Model/StateController.swift index d795ef3c..b86260ec 100644 --- a/ChatLayout/Classes/Core/Model/StateController.swift +++ b/ChatLayout/Classes/Core/Model/StateController.swift @@ -267,10 +267,7 @@ final class StateController { func section(at index: Int, at state: ModelState) -> SectionModel { guard index < layout(at: state).sections.count else { - preconditionFailure(""" - Section index \(index) is bigger than the amount of - sections \(layout(at: state).sections.count) - """) + preconditionFailure("Section index \(index) is bigger than the amount of sections \(layout(at: state).sections.count)") } return layout(at: state).sections[index] } diff --git a/Example/.swiftlint.yml b/Example/.swiftlint.yml deleted file mode 100644 index 2e784982..00000000 --- a/Example/.swiftlint.yml +++ /dev/null @@ -1,73 +0,0 @@ -disabled_rules: # rule identifiers to exclude from running - - colon - - comma - - control_statement - - nesting -opt_in_rules: # some rules are only opt-in - - empty_count - # Find all the available rules by running: - # swiftlint rules -included: # paths to include during linting. `--path` is ignored if present. - - Example - - RouteComposer -excluded: # paths to ignore during linting. Takes precedence over `included`. - - Carthage - - Pods - - Source/ExcludedFolder - - Source/ExcludedFile.swift - - Source/*/ExcludedFile.swift # Exclude files with a wildcard - -# configurable rules can be customized from this configuration file -# binary rules can set their severity level -force_cast: warning # implicitly -force_try: - severity: warning # explicitly -# rules that have both warning and error levels, can set just the warning level -# implicitly -line_length: 180 - -# they can set both implicitly with an array -type_body_length: - - 400 # warning - - 500 # error - -function_body_length: - - 150 # warning - - 200 # error - -cyclomatic_complexity: - - 15 # warning - - 25 # error - - -# or they can set both explicitly -file_length: - warning: 500 - error: 1200 - -# naming rules can set warnings/errors for min_length and max_length -# additionally they can set excluded names -type_name: - min_length: 4 # only warning - max_length: # warning and error - warning: 40 - error: 50 - excluded: iPhone # excluded via string - -identifier_name: - min_length: # only min_length - error: 3 # only error - excluded: # excluded via string array - - id - - vc - - key - - url - - URL - - GlobalAPIKey - -function_parameter_count: 6 - -large_tuple: - - 4 - - 10 -reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, junit, html, emoji, sonarqube) \ No newline at end of file diff --git a/Example/.swiftlint.yml b/Example/.swiftlint.yml new file mode 120000 index 00000000..0cfd7879 --- /dev/null +++ b/Example/.swiftlint.yml @@ -0,0 +1 @@ +./../.swiftlint.yml \ No newline at end of file diff --git a/README.md b/README.md index a2e2fb6d..6e9f8774 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ [![Version](https://img.shields.io/cocoapods/v/ChatLayout.svg?style=flat)](https://cocoapods.org/pods/ChatLayout) [![Documentation](https://ekazaev.github.io/ChatLayout/badge.svg)](https://ekazaev.github.io/ChatLayout/) [![Codecov](https://codecov.io/gh/ekazaev/ChatLayout/branch/master/graph/badge.svg)](https://codecov.io/gh/ekazaev/ChatLayout) +[![Codacy Badge](https://app.codacy.com/project/badge/Grade/b97c279a50984376ab2649f5a7d09e69)](https://www.codacy.com/gh/ekazaev/ChatLayout/dashboard?utm_source=github.com&utm_medium=referral&utm_content=ekazaev/ChatLayout&utm_campaign=Badge_Grade) [![Swift Package Manager](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg?style=flat)](https://github.com/apple/swift-package-manager) [![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BA51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Swift 5.2](https://img.shields.io/badge/language-Swift5.2-orange.svg?style=flat)](https://developer.apple.com/swift)