This repository has been archived by the owner on Jul 17, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from jumpper/enhancement/PatronizeClasses
Adjusts and tests
- Loading branch information
Showing
76 changed files
with
974 additions
and
388 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
swiftlint: | ||
config_file: .swiftlint.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
disabled_rules: # rule identifiers to exclude from running | ||
- identifier_name | ||
- large_tuple | ||
- trailing_whitespace | ||
- type_body_length | ||
- cyclomatic_complexity | ||
- function_parameter_count | ||
|
||
excluded: # paths to ignore during linting. Takes precedence over `included`. | ||
- Carthage | ||
- Pods | ||
|
||
type_name: | ||
min_length: 1 | ||
max_length: 40 | ||
|
||
identifier_name: | ||
min_length: # only min_length | ||
error: 3 # only error | ||
excluded: # excluded via string array | ||
- id | ||
- i | ||
- ok | ||
- x | ||
- y | ||
- URL | ||
- GlobalAPIKey | ||
- yes | ||
- no | ||
- A | ||
- H1 | ||
- H2 | ||
- H3 | ||
- H4 | ||
- H5 | ||
- H6 | ||
- UL | ||
- LI | ||
- OL | ||
- DD | ||
- DL | ||
- DT | ||
- Tr | ||
- Td | ||
- Th | ||
- Em | ||
- Em | ||
|
||
|
||
|
||
line_length: | ||
warning: 150 | ||
error: 300 | ||
ignores_comments: true | ||
ignores_urls: true | ||
ignores_function_declarations: true | ||
### works up until this config rule | ||
ignores_interpolated_strings: true | ||
|
||
function_body_length: | ||
warning: 60 | ||
error: 80 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// | ||
// ContainerElementBase.swift | ||
// | ||
// | ||
// Created by Michel Anderson Lutz Teixeira on 10/07/20. | ||
// | ||
|
||
import Foundation | ||
|
||
/// Define a base class to containered tag elements | ||
public class ContainerElementBase: GenericElement { | ||
///Override container element defaults is `true` | ||
override var container: Bool { | ||
get { | ||
return true | ||
} | ||
} | ||
///This method append a new element in objects list | ||
/// - Parameter element: Generic Type `ElementProtocol` or `String` | ||
func add<T>(_ element: T) { | ||
if let textElement = element as? String { | ||
let text = factoryTextWith(textElement) | ||
|
||
objects.append(text) | ||
} else { | ||
guard let genericElement = element as? ElementProtocol else { return } | ||
|
||
objects.append(genericElement) | ||
} | ||
} | ||
/// This method create a `Text` element to user when element T String is passed on add method | ||
/// - Parameter text: `String` to create `Text` element | ||
/// - Returns: `Text` Element with string passed | ||
private func factoryTextWith(_ text: String) -> Text { | ||
return Text(text) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.