Skip to content

Commit

Permalink
Merge pull request #2207 from CruGlobal/develop
Browse files Browse the repository at this point in the history
Merge develop into master
  • Loading branch information
levieggertcru authored Jul 17, 2024
2 parents b31e4f2 + 46ae1f0 commit cb7e05b
Show file tree
Hide file tree
Showing 192 changed files with 768 additions and 577 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/create-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Create Version

on:
push:
branches: [ main ]
branches: [ main, releases/* ]
pull_request:
branches: [ main ]
branches: [ main, releases/* ]

workflow_dispatch:
inputs:
Expand Down Expand Up @@ -61,7 +61,7 @@ jobs:
- name: Set Version Output
id: version
run: |
echo "version=$(grep -m 1 MARKETING_VERSION godtools.xcodeproj/project.pbxproj | sed 's/;//g' | sed 's/ //g' | sed 's/=//g' | sed 's/MARKETING_VERSION//g')" >> $GITHUB_OUTPUT
echo "version=$(grep -m 1 MARKETING_VERSION godtools.xcodeproj/project.pbxproj | sed 's/;//g' | sed 's/ //g' | sed 's/=//g' | sed 's/MARKETING_VERSION//g' | sed 's/^ *//g' | sed 's/^[[:space:]]*//g')" >> $GITHUB_OUTPUT
print_current_version:
name: Print Current Version
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Run Tests

on:
push:
branches: [ develop, master, feature/* ]
branches: [ develop, master, feature/*, releases/* ]
pull_request:
branches: [ develop, master, feature/* ]
branches: [ develop, master, feature/*, releases/* ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/swift-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Swift Lint

on:
pull_request:
branches: [ develop, master, feature/*, releases/* ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
swift_lint:
runs-on: macos-14
env:
FASTLANE_XCODEBUILD_SETTINGS_TIMEOUT: 60

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install SwiftLint
run: brew install swiftlint

- name: Pod Install
uses: ./.github/actions/pod-install

- name: Swift Lint
run: bundle exec fastlane cru_shared_lane_swift_lint config_file:./.swiftlint.yml raise_if_swiftlint_error:true
2 changes: 1 addition & 1 deletion .github/workflows/testflight.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Distribute To Testflight

on:
push:
branches: [ master ]
branches: [ master, releases/* ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
142 changes: 142 additions & 0 deletions .swiftlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
# By default, SwiftLint uses a set of sensible default rules you can adjust:
disabled_rules: # rule identifiers turned on by default to exclude from running
- cyclomatic_complexity #disabling for now as this touches many files.
- empty_enum_arguments #disabling for now as this touches many files.
- function_body_length #disabling for now as this touches many files.
- function_parameter_count #disabling for now as this touches many files.
- inclusive_language
- multiple_closures_with_trailing_closure #disabling for now as this touches many files.
- opening_brace #disabling for now as this touches many files.
- redundant_string_enum_value
- statement_position #disabling for now as this touches many files.
- todo #disabling for now as this touches many files.
- trailing_whitespace #disabling for now as this touches many files. Command swiftlint --fix is a way to fix whitespace.
- unused_closure_parameter #disabling for now as this touches many files.
opt_in_rules: # some rules are turned off by default, so you need to opt-in
- closure_end_indentation
# - closure_spacing #disabling for now as this touches many files.
- collection_alignment
- comma_inheritance
- conditional_returns_on_newline
# - convenience_type #disabling for now as this touches many files.
- discouraged_none_name
- discouraged_object_literal
# - empty_count #disabling for now as this touches many files.
- empty_string
- enum_case_associated_values_count
# - explicit_enum_raw_value #disabling for now as this touches many files.
# - explicit_type_interface
- fallthrough
- fatal_error_message
- file_name_no_space
# - file_types_order #Curious about this one. ~Levi
- first_where
- force_unwrapping
- function_default_parameter_at_end
- ibinspectable_in_extension
- identical_operands
# - implicit_return #disabling for now as this touches many files.
- implicitly_unwrapped_optional
- indentation_width
- last_where
- let_var_whitespace
- literal_expression_end_indentation
# - multiline_arguments #Disabling this rule as UIView.animate would fail when using animate and completion together.
# - multiline_arguments_brackets #disabling for now as this touches many files.
- multiline_function_chains
- multiline_literal_brackets
- multiline_parameters
- multiline_parameters_brackets
- no_extension_access_modifier
# - no_magic_numbers #disabling for now as this touches many files.
# - one_declaration_per_file #SwiftUI Preview breaks this, may need to update preview to use macros.
- operator_usage_whitespace
# - prefer_self_in_static_references #disabling for now as this touches many files.
- prefer_self_type_over_type_of_self
- private_action
- private_outlet
- private_subject
- private_swiftui_state
# - sorted_enum_cases #disabling for now as this touches many files.
- strict_fileprivate
- switch_case_on_newline
- toggle_bool
# - trailing_closure #disabling for now as this touches many files.
- unowned_variable_capture
- weak_delegate
- yoda_condition

# Alternatively, specify all rules explicitly by uncommenting this option:
# only_rules: # delete `disabled_rules` & `opt_in_rules` if using this
# - empty_parameters
# - vertical_whitespace

analyzer_rules: # rules run by `swiftlint analyze`
- capture_variable
- explicit_self
- unused_import

# Case-sensitive paths to include during linting. Directory paths supplied on the
# command line will be ignored.
included:
- godtools/App
excluded: # case-sensitive paths to ignore during linting. Takes precedence over `included`
- godtools/App/Flows/Flow/FlowStep.swift
- Carthage
- Pods
- Sources/ExcludedFolder
- Sources/ExcludedFile.swift
- Sources/*/ExcludedFile.swift # exclude files with a wildcard

# If true, SwiftLint will not fail if no lintable files are found.
allow_zero_lintable_files: false

# If true, SwiftLint will treat all warnings as errors.
strict: false

# The path to a baseline file, which will be used to filter out detected violations.
baseline: Baseline.json

# The path to save detected violations to as a new baseline.
write_baseline: Baseline.json

# If true, SwiftLint will check for updates after linting or analyzing.
check_for_updates: true

# 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: 1200
# they can set both implicitly with an array
type_body_length:
- 500 # warning
- 600 # error
# or they can set both explicitly
file_length:
warning: 1500
error: 2000
# 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: 80
error: 90
excluded: iPhone # excluded via string
allowed_symbols: ["_"] # these are allowed in type names
identifier_name:
min_length: # only min_length
warning: 1
error: 1 # only error
max_length: # warning and error
warning: 80
error: 90
excluded: # excluded via string array
- id
- URL
- GlobalAPIKey
reporter: "xcode" # reporter type (xcode, json, csv, checkstyle, codeclimate, junit, html, emoji, sonarqube, markdown, github-actions-logging, summary)
22 changes: 11 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@ GEM
artifactory (3.0.17)
atomos (0.1.3)
aws-eventstream (1.3.0)
aws-partitions (1.949.0)
aws-sdk-core (3.200.0)
aws-partitions (1.956.0)
aws-sdk-core (3.201.1)
aws-eventstream (~> 1, >= 1.3.0)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.8)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.87.0)
aws-sdk-core (~> 3, >= 3.199.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.155.0)
aws-sdk-core (~> 3, >= 3.199.0)
aws-sdk-kms (1.88.0)
aws-sdk-core (~> 3, >= 3.201.0)
aws-sigv4 (~> 1.5)
aws-sdk-s3 (1.156.0)
aws-sdk-core (~> 3, >= 3.201.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.8)
aws-sigv4 (~> 1.5)
aws-sigv4 (1.8.0)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
Expand Down Expand Up @@ -95,7 +95,7 @@ GEM
escape (0.0.4)
ethon (0.16.0)
ffi (>= 1.15.0)
excon (0.110.0)
excon (0.111.0)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
Expand Down Expand Up @@ -223,8 +223,8 @@ GEM
base64
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0604)
mini_magick (4.13.1)
mime-types-data (3.2024.0702)
mini_magick (4.13.2)
mini_mime (1.1.5)
minitest (5.24.1)
molinillo (0.8.0)
Expand Down
11 changes: 11 additions & 0 deletions fastlane/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,17 @@ For _fastlane_ installation instructions, see [Installing _fastlane_](https://do

# Available Actions

### cru_shared_lane_swift_lint

```sh
[bundle exec] fastlane cru_shared_lane_swift_lint
```



----


## iOS

### ios release
Expand Down
4 changes: 2 additions & 2 deletions godtools/App/AppBuild/AppBuild.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ class AppBuild {
configuration = .release
}
else if let buildConfiguration = buildConfiguration {
configuration = buildConfiguration
configuration = buildConfiguration
}
else if isDebug {
configuration = .staging
}
else {
configuration = .release
configuration = .release
}

switch configuration {
Expand Down
2 changes: 1 addition & 1 deletion godtools/App/AppBuild/AppBuildConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Foundation
enum AppBuildConfiguration {

case analyticsLogging
case staging
case production
case release
case staging
}
2 changes: 1 addition & 1 deletion godtools/App/AppBuild/AppEnvironment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ import Foundation

enum AppEnvironment {

case staging
case production
case staging
}
13 changes: 5 additions & 8 deletions godtools/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

let uiTestsDeepLinkString: String? = ProcessInfo.processInfo.environment[LaunchEnvironmentKey.urlDeeplink.value]

if let uiTestsDeepLinkString = uiTestsDeepLinkString, !uiTestsDeepLinkString.isEmpty,
let url = URL(string: uiTestsDeepLinkString) {

if let uiTestsDeepLinkString = uiTestsDeepLinkString, !uiTestsDeepLinkString.isEmpty, let url = URL(string: uiTestsDeepLinkString) {
_ = appDeepLinkingService.parseDeepLinkAndNotify(incomingDeepLink: .url(incomingUrl: IncomingDeepLinkUrl(url: url)))
}

Expand Down Expand Up @@ -156,12 +154,12 @@ extension AppDelegate {
appDiContainer.dataLayer.getSharedAppsFlyer().registerUninstall(deviceToken: deviceToken)
}

func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any]) {

appDiContainer.dataLayer.getSharedAppsFlyer().handlePushNotification(userInfo: userInfo)
}

func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {

appDiContainer.dataLayer.getSharedAppsFlyer().handlePushNotification(userInfo: userInfo)
}
Expand All @@ -177,8 +175,7 @@ extension AppDelegate {

let successfullyHandledQuickAction: Bool

if let toolDeepLinkUrlString = ToolShortcutLinksView.getToolDeepLinkUrl(shortcutItem: shortcutItem),
let toolDeepLinkUrl = URL(string: toolDeepLinkUrlString) {
if let toolDeepLinkUrlString = ToolShortcutLinksView.getToolDeepLinkUrl(shortcutItem: shortcutItem), let toolDeepLinkUrl = URL(string: toolDeepLinkUrlString) {

let trackActionAnalyticsUseCase: TrackActionAnalyticsUseCase = appDiContainer.domainLayer.getTrackActionAnalyticsUseCase()

Expand Down Expand Up @@ -212,7 +209,7 @@ extension AppDelegate {

extension AppDelegate {

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {
func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey: Any] = [:]) -> Bool {

appDiContainer.dataLayer.getSharedAppsFlyer().handleOpenUrl(url: url, options: options)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ class AppDataLayerDependencies {

func getTranslatedToolCategory() -> GetTranslatedToolCategory {
return GetTranslatedToolCategory(
languagesRepository: getLanguagesRepository(),
localizationServices: getLocalizationServices(),
resourcesRepository: getResourcesRepository()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ extension AppleAuthentication: AuthenticationProviderInterface {
func authenticatePublisher(presentingViewController: UIViewController) -> AnyPublisher<AuthenticationProviderResponse, Error> {

return authenticatePublisher()
.flatMap ({ (response: AppleAuthenticationResponse) -> AnyPublisher<AuthenticationProviderResponse, Error> in
.flatMap({ (response: AppleAuthenticationResponse) -> AnyPublisher<AuthenticationProviderResponse, Error> in

if response.isCancelled {
return Fail(error: NSError.userCancelledError())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ struct AuthUserDomainModel {
let name: String?
let ssoGuid: String?
}

Loading

0 comments on commit cb7e05b

Please sign in to comment.