Skip to content

Create FinanceFoundations SDK #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# ------------------------------------------------------------------------------
# INCLUDE, EXCLUDE & IGNORED PATHS
# ------------------------------------------------------------------------------

# paths to ignore during linting.
excluded:
- Pods
- SampleApp
- SampleAppTests

# ------------------------------------------------------------------------------
# EXCLUDE & IGNORED RULES
# ------------------------------------------------------------------------------

# rule identifiers to exclude from running
disabled_rules:
- trailing_whitespace
- large_tuple
- missing_docs
- cyclomatic_complexity
- for_where
- class_delegate_protocol
- private_over_fileprivate
opt_in_rules: # some rules are only opt-in
- overridden_super_call
- closure_spacing
- closure_end_indentation
- redundant_nil_coalescing
- operator_usage_whitespace
- explicit_init
- vertical_parameter_alignment_on_call
- conditional_returns_on_newline
# Find all the available rules by running:
# swiftlint rules

# ------------------------------------------------------------------------------
# LENGHT RULES
# ------------------------------------------------------------------------------

# file
file_length:
warning: 1500 # lenght considered warning
error: 1700
# type body
type_body_length:
- 400 # lenght considered warning

# code line
line_length: 500

#function_parameter_count
function_parameter_count:
warning: 15
error: 20

# ------------------------------------------------------------------------------
# NAMING RULES
# ------------------------------------------------------------------------------

identifier_name:
severity: warning
min_length: 1 # only warning
max_length: 80 # warning
excluded: # excluded via string array
- id
- URL
- url
- map
- key
- rhs
- lhs
- Strings
allowed_symbols: ["_"] # these are allowed in type names

type_name:
min_length: 3 # only warning
max_length: # warning and error
warning: 40
error: 200
excluded: iPhone # excluded via string
allowed_symbols: ["_"] # these are allowed in type names

shorthand_operator: warning
type_name: warning
force_cast: warning

# ------------------------------------------------------------------------------
# CUSTOM RULES
# ------------------------------------------------------------------------------

custom_rules:

# Style Guide
sg_nil_verification:
name: "SG nil verification"
regex: "(!=[ ]*nil[ ]*[{][ ]*[}]|==[ ]*nil[ ]*[{][ ]*[}])"
message: "Avoid use != nil {} or == nil {}. Example: instead of using 'param != nil {} else', use 'param == nil'"
severity: warning

# Style Guide
is_not_empty_rule:
name: "Not empty verification SG"
regex: "([.]count|[.]length[(][)] )[ ]*>[ ]*0"
message: "Use IsNotEmpty instead of count > 0"
severity: warning

# Style Guide
isEmpty_rule:
name: "Empty verification SG"
regex: "([.]count|[.]length[(][)] )[ ]*==[ ]*0"
message: "Use isEmpty instead of count == 0"
severity: warning

# Use to avoid unnecessary inheritance
viewModel_unnecessary_inheritance:
name: "Presenter Inheritance "
regex: "Presenter[ ]*:[ ]*NSObject"
message: "Presenter unnecessary inheritance"
severity: warning

# Use localized before to upperCase or lowerCase a String
localized_rule:
name: "Localized rule"
regex: "cased[(][])].localized"
message: "Use localized before to upperCase or lowerCase a String"
severity: warning

# ------------------------------------------------------------------------------
# REPORTER TYPE (xcode, json, csv, checkstyle, junit, html, emoji)
# ------------------------------------------------------------------------------

reporter: "xcode"
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Pod::Spec.new do |spec|

spec.name = 'FinanceFoundations'
spec.version = '0.1.0'
spec.summary = 'Foundations Framework.'
spec.homepage = 'https://framework.com'
spec.author = { 'Munizin' => "pmdm.sys@gmail.com" }
spec.license = { :type => 'Private' }
spec.source = { :git => 'https://framework-source-code.git',
:tag => spec.version.to_s }

spec.ios.deployment_target = '13.0'
spec.requires_arc = true

spec.cocoapods_version = '>= 1.5'
spec.swift_version = '5.4'

spec.source_files = 'FinanceFoundations/**/*.{h,m,swift}'

spec.resource_bundles = {
'FinanceFoundations' => [
'FinanceFoundations/**/*.xcassets',
'FinanceFoundations/**/*.xib'
]
}

spec.resources = [
'FinanceFoundations/**/*.strings'
]

end
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// String+Extensions.swift
// FinanceFoundations
//
// Created by Philippe Muniz Gomes on 03/03/23.
//

import Foundation

extension String {

public static func activityDetails(with price: Float, and time: String) -> String {
return "$\(price) • \(time)"
}
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//
// UITableViewCell+Extensions.swift
// FinanceApp
// FinanceFoundations
//
// Created by Rodrigo Borges on 24/02/22.
// Created by Philippe Muniz Gomes on 03/03/23.
//

import Foundation
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// MARK: - Feature

"Feature.Example.HelloWorld" = "Hello World from SDK!!";
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//
// FinanceFoundationsInitializerTests.swift
// FinanceFoundationsTests
//

import XCTest
@testable import FinanceFoundations

final class FinanceFoundationsInitializerTests: XCTestCase {

func testHellorWorld() {
XCTAssertEqual(FinanceFoundationsInitializer.helloWorld(), "Hello World from SDK!!")
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source "https://rubygems.org"

gem "xcpretty"
gem "cocoapods", '1.10.2'
gem "xcode-install"
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

source 'https://cdn.cocoapods.org/'

platform :ios, '13.0'

inhibit_all_warnings!
use_frameworks!

workspace 'FinanceFoundations'

target 'FinanceFoundations' do

pod 'SwiftLint'
pod 'SwiftGen', '6.5.1'

target 'FinanceFoundationsTests' do
# pod 'Dependency', '~> 1.0.0'
end
end

target 'SampleApp' do
project 'SampleApp/SampleApp'
pod 'FinanceFoundations', :path => './'
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//
// AppDelegate.swift
// SampleApp
//

import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

let window = UIWindow(frame: UIScreen.main.bounds)
window.backgroundColor = .white
window.makeKeyAndVisible()
window.rootViewController = UINavigationController(rootViewController: ViewController())
self.window = window

return true
}

}
Loading