Skip to content

Commit

Permalink
Merge pull request #3 from Igor-Palaguta/Global-Refresh
Browse files Browse the repository at this point in the history
Global refresh
  • Loading branch information
Igor-Palaguta authored Feb 15, 2019
2 parents 1121a48 + 9c39a21 commit 22d24b3
Show file tree
Hide file tree
Showing 86 changed files with 668 additions and 2,674 deletions.
39 changes: 2 additions & 37 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ motoswift/
*.perspectivev3
!default.perspectivev3
xcuserdata/
.DS_Store

## Other
*.moved-aside
Expand All @@ -29,41 +30,5 @@ xcuserdata/
*.dSYM
*.pkg

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
Packages/
.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
Pods/

Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
Carthage/Checkouts

Carthage/Build

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output

MotoSwift.xcodeproj/
motoswift.xcodeproj/
2 changes: 1 addition & 1 deletion .swift-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0
4.2
119 changes: 119 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
identifier_name:
min_length:
warning: 2
error: 2
max_length:
warning: 50
error: 60

type_name:
min_length:
warning: 2
error: 2
max_length:
warning: 50
error: 50

line_length:
warning: 120
ignores_comments: true

type_body_length:
warning: 100
error: 200

trailing_whitespace:
ignores_empty_lines: true

cyclomatic_complexity:
warning: 15

private_outlet:
allow_private_set: true

trailing_closure:
only_single_muted_parameter: true

opt_in_rules:
- anyobject_protocol
- array_init
- attributes
- closure_body_length
- closure_end_indentation
- closure_spacing
- collection_alignment
- contains_over_first_not_nil
- conditional_returns_on_newline
- discouraged_object_literal
- discouraged_optional_boolean
- empty_count
- empty_string
- empty_xctest_method
- explicit_init
- fallthrough
- fatal_error_message
- first_where
- force_unwrapping
- function_default_parameter_at_end
- identical_operands
- implicit_return
- joined_default_parameter
- let_var_whitespace
- literal_expression_end_indentation
- legacy_random
- lower_acl_than_parent
- modifier_order
- multiline_arguments
- multiline_parameters
- nimble_operator
- operator_usage_whitespace
- overridden_super_call
- pattern_matching_keywords
- private_action
- private_outlet
- prohibited_super_call
- redundant_nil_coalescing
- redundant_type_annotation
- single_test_class
- sorted_first_last
- sorted_imports
- static_operator
- strict_fileprivate
- strong_iboutlet
- switch_case_on_newline
- toggle_bool
- trailing_closure
- unavailable_function
- unneeded_parentheses_in_closure_argument
- unused_import
- unused_private_declaration
- vertical_parameter_alignment_on_call
- yoda_condition

excluded:
- .git
- .build

custom_rules:
tabs:
name: "Tabs"
regex: "\t"
message: "Avoid using tabs."
public_extension:
name: "Public Extension"
regex: "public extension"
message: "Avoid using public extensions."
fileprivate_extension:
name: "Fileprivate Extension"
regex: "fileprivate extension"
message: "Use private extensions instead of fileprivate."
leading_space_in_comment:
name: "Whitespace After Slash Comments"
regex: "[^:]//[^\\s]"
message: "Leading space should be added to comments"
match_kinds:
- comment
one_assignment_space:
name: "One Assignment Space"
regex: "( =)|(= )"
message: "Just one space should be before and after assignment"
14 changes: 11 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,22 @@ TEST_RESOURCES_PATH=$(HOME_PATH)/Tests/MotoSwiftFrameworkTests/Resources
MOMC_PATH=$(shell dirname $(shell xcrun -find momc))

lint:
swiftlint lint --path ./Source
swiftlint

build:
swift build --configuration $(BUILD_CONFIGURATION)

samples: build
"$(BUILD_PATH)" machine --template ./Templates/mogenerator/human.stencil --output ./SampleOutput/Mogenerator/Human --file-mask "{{class}}.swift" $(TEST_RESOURCES_PATH)/TypesModel.xcdatamodeld
"$(BUILD_PATH)" machine --template ./Templates/mogenerator/machine.stencil --output ./SampleOutput/Mogenerator/Machine --file-mask "_{{class}}.swift" $(TEST_RESOURCES_PATH)/TypesModel.xcdatamodeld
"$(BUILD_PATH)" machine --template ./Templates/xcode/class.stencil --output ./SampleOutput/Xcode --file-mask "{{class}}+CoreDataClass.swift" $(TEST_RESOURCES_PATH)/TypesModel.xcdatamodeld
"$(BUILD_PATH)" machine --template ./Templates/xcode/properties.stencil --output ./SampleOutput/Xcode --file-mask "{{class}}+CoreDataProperties.swift" $(TEST_RESOURCES_PATH)/TypesModel.xcdatamodeld
"$(BUILD_PATH)" model --template ./Templates/model.stencil --output ./SampleOutput/Model/Model.swift $(TEST_RESOURCES_PATH)/TypesModel.xcdatamodeld

.prepare_test_data: build
"$(BUILD_PATH)" machine --template ./Templates/class.stencil --output ./Tests/MotoSwiftFrameworkTests/Generated --file-mask "{{class}}+CoreDataClass.swift" $(TEST_RESOURCES_PATH)/TypesModel.xcdatamodeld
"$(BUILD_PATH)" machine --template ./Templates/properties.stencil --output ./Tests/MotoSwiftFrameworkTests/Generated --file-mask "{{class}}+CoreDataProperties.swift" $(TEST_RESOURCES_PATH)/TypesModel.xcdatamodeld
"$(BUILD_PATH)" machine --template ./Templates/xcode/class.stencil --output ./Tests/MotoSwiftFrameworkTests/Generated --file-mask "{{class}}+CoreDataClass.swift" $(TEST_RESOURCES_PATH)/TypesModel.xcdatamodeld
"$(BUILD_PATH)" machine --template ./Templates/xcode/properties.stencil --output ./Tests/MotoSwiftFrameworkTests/Generated --file-mask "{{class}}+CoreDataProperties.swift" $(TEST_RESOURCES_PATH)/TypesModel.xcdatamodeld
"$(BUILD_PATH)" model --template ./Templates/model.stencil --output ./Tests/MotoSwiftFrameworkTests/Generated/Model.swift $(TEST_RESOURCES_PATH)/TypesModel.xcdatamodeld
cd "$(MOMC_PATH)"; xcrun momc $(TEST_RESOURCES_PATH)/TypesModel.xcdatamodeld $(TEST_RESOURCES_PATH)/TypesModel.momd

test: .prepare_test_data
Expand Down
23 changes: 0 additions & 23 deletions MotoSwift.podspec

This file was deleted.

25 changes: 0 additions & 25 deletions MotoSwift.xcodeproj/Commander_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions MotoSwift.xcodeproj/MotoSwiftFrameworkTests_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions MotoSwift.xcodeproj/MotoSwiftFramework_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions MotoSwift.xcodeproj/Nimble_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions MotoSwift.xcodeproj/PathKit_Info.plist

This file was deleted.

25 changes: 0 additions & 25 deletions MotoSwift.xcodeproj/Quick_Info.plist

This file was deleted.

Loading

0 comments on commit 22d24b3

Please sign in to comment.