Skip to content

Commit

Permalink
feat: Swiftlint , swiftgen file generation
Browse files Browse the repository at this point in the history
  • Loading branch information
andrej-jasso committed Jan 29, 2021
1 parent 98c128a commit 5d4b147
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 1 deletion.
67 changes: 67 additions & 0 deletions Project Templates/Custom/Good Project.xctemplate/.swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
excluded:
- Pods
- sfzfans/Extensions/GoodSwift.swift

opt_in_rules:
- include-whitespace-only-lines
- empty_string
- colon
- comma
- array_init
- attributes
- first_where
- vertical_whitespace_between_cases
- explicit_self
- yoda_condition
- unused_import
- fallthrough
- flatmap_over_map_reduce
- unused_declaration
- force_unwrapping
- unowned_variable_capture
- redundant_set_access_control
- redundant_type_annotation
- sorted_first_last

custom_rules:

already_true:
regex: "== true"
message: "Don't compare to true, just use the bool value."
already_bool:
regex: "== false"
message: "Don't compare to false, just use !value."

disabled_rules:
- identifier_name
- valid_docs
- type_name
- trailing_whitespace
- unowned_variable_capture

file_length:
warning: 550
error: 1200

large_tuple:
- 4
- 5

line_length:
warning: 250
error: 500
ignores_function_declarations: true
ignores_comments: true
ignores_urls: true

cyclomatic_complexity: 12
function_body_length:
warning: 80
error: 100
function_parameter_count: 5

type_body_length: 300

reporter: "xcode"
# // swiftlint:disable <rule1>
# // swiftlint:enable <rule1>
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,18 @@
<string>Resource</string>
</array>
</dict>
<key>../swiftgen.yml</key>
<dict>
<key>Group</key>
<string>Resource</string>
<key>Path</key>
<string>swiftgen.yml</string>
</dict>
<key>../.swiftlint.yml</key>
<dict>
<key>Group</key>
<string>Resource</string>
</dict>
</dict>
<key>Nodes</key>
<array>
Expand All @@ -176,9 +188,11 @@
<string>Manager/Request/RequestManagerType.swift</string>
<string>Manager/Request/Endpoint.swift</string>
<string>Extension/UIKit/UIView.swift</string>
<string>Extension/Foundation/String.swift</string>
<string>Resource/Colors.xcassets</string>
<string>Resource/Assets.xcassets</string>
<string>Extension/Foundation/String.swift</string>
<string>../swiftgen.yml</string>
<string>../.swiftlint.yml</string>
<string>Info.plist:UIMainStoryboardFile</string>
<string>Info.plist:UIApplicationSceneManifest:UISceneStoryboardFile</string>
</array>
Expand Down
20 changes: 20 additions & 0 deletions Project Templates/Custom/Good Project.xctemplate/swiftgen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
strings:
inputs: sfzfans/Resources/Localization/Localizable.strings
outputs:
- templateName: structured-swift5
output: sfzfans/Resources/Generated/Localizable.swift
params:
enumName: L
xcassets:
- inputs: sfzfans/Resources/Assets.xcassets
outputs:
- templateName: swift5
output: sfzfans/Resources/Generated/Assets.swift
params:
enumName: Asset
- inputs: sfzfans/Resources/Colors.xcassets
outputs:
- templateName: swift5
output: sfzfans/Resources/Generated/Colors.swift
params:
enumName: Color

0 comments on commit 5d4b147

Please sign in to comment.