Skip to content
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

Merge develop into master #2207

Merged
merged 67 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
b80cfee
Add swiftlint config and workflow
levieggertcru Jul 9, 2024
6bd70d5
Install swift lint
levieggertcru Jul 9, 2024
ed1e157
Update config path
levieggertcru Jul 9, 2024
a64e3ed
Add path to lint
levieggertcru Jul 9, 2024
06ed746
Remove mode
levieggertcru Jul 9, 2024
9d923fb
Move file
levieggertcru Jul 9, 2024
239237f
Update included
levieggertcru Jul 9, 2024
fc71ce2
Add some opt ins
levieggertcru Jul 9, 2024
703c255
Remove white space
levieggertcru Jul 10, 2024
21d5953
Merge pull request #2196 from CruGlobal/GT-create-version
levieggertcru Jul 10, 2024
e34fdb1
Merge branch 'develop' into GT-swift-lint
levieggertcru Jul 10, 2024
636440b
[create-pull-request] automated change
levieggertcru Jul 10, 2024
ac72792
convert to language ID to check if language is supported
rachaelblue Jul 11, 2024
e5bf49a
Add additional opt in parameters
levieggertcru Jul 12, 2024
a4a04d8
Change type to BCP47LanguageIdentifier for code attribute
levieggertcru Jul 12, 2024
9f6753f
Lock file maintenance
renovate[bot] Jul 15, 2024
99aff95
Add some opt ins
levieggertcru Jul 15, 2024
c5acea9
Merge pull request #2202 from CruGlobal/renovate/lock-file-maintenance
levieggertcru Jul 15, 2024
2dce76c
Merge pull request #2199 from CruGlobal/latest-onesky-translations
levieggertcru Jul 15, 2024
a1bad6e
Update opt ins and analyzer rules
levieggertcru Jul 15, 2024
b84726b
Merge branch 'develop' into GT-swift-lint
levieggertcru Jul 15, 2024
077693c
sort enum cases
levieggertcru Jul 15, 2024
1d24e9e
Disable trailing white space
levieggertcru Jul 15, 2024
e11d722
Comment out some rules until they can be resolved at a later time
levieggertcru Jul 15, 2024
f7352f4
Update length to 4 letters
levieggertcru Jul 15, 2024
e3a23f3
FIx colon spacing
levieggertcru Jul 15, 2024
84d038e
Update to spacings where colons are
levieggertcru Jul 15, 2024
4d909de
Fix operator whitespace
levieggertcru Jul 15, 2024
1f86ee0
Disabling some default rules and will enable at a later time
levieggertcru Jul 15, 2024
a28037a
Fix comma spacing
levieggertcru Jul 15, 2024
4c6edfb
Remove FlowStep from linting due to enum case sorting
levieggertcru Jul 15, 2024
da92d3f
Fix to vertical whitespace
levieggertcru Jul 15, 2024
2a911de
Fix operator usage whitespace
levieggertcru Jul 15, 2024
878e542
Disable some rules due to many warnings
levieggertcru Jul 15, 2024
02c010c
Fix swift lint redundant_optional_initialization
levieggertcru Jul 15, 2024
d506051
Update max length
levieggertcru Jul 15, 2024
a1246ce
Set min length to 2
levieggertcru Jul 15, 2024
7948d6f
resolve identifier_name swift lint errors
levieggertcru Jul 15, 2024
b3e13a9
Remove extension access modifier
levieggertcru Jul 15, 2024
b12ef1c
Fix swift lint indentation_width
levieggertcru Jul 15, 2024
31600e9
Fix swift lint closure_end_indentation
levieggertcru Jul 15, 2024
dd4ade7
Fix swift lint (multiline_function_chains)
levieggertcru Jul 16, 2024
ff65b93
Fix swift lint unneeded_override
levieggertcru Jul 16, 2024
ad411ee
Fix swift lint shorthand_operator
levieggertcru Jul 16, 2024
1973c44
Fix swift lint conditional_returns_on_newline
levieggertcru Jul 16, 2024
2abe131
Disable some default rules as too many to fix at this point
levieggertcru Jul 16, 2024
17d4206
Fix swift lint force_cast
levieggertcru Jul 16, 2024
f603a0a
Fix swift lint implicitly_unwrapped_optional
levieggertcru Jul 16, 2024
541058f
Fix swift lint trailing_newline
levieggertcru Jul 16, 2024
3cbcaf5
Fix swift lint indentation_width
levieggertcru Jul 16, 2024
f63b032
Fix swift lint no_space_in_method_call
levieggertcru Jul 16, 2024
f7140bd
Fix swift lint return_arrow_whitespace
levieggertcru Jul 16, 2024
4af129f
Fix swift lint syntactic_sugar
levieggertcru Jul 16, 2024
1763257
Fix swift lint for_where
levieggertcru Jul 16, 2024
faadecb
Disable cyclomatic_complexity for now
levieggertcru Jul 16, 2024
b7dbd95
Fix swift lint comment_spacing
levieggertcru Jul 16, 2024
e0edd45
Fix swift lint discouraged_none_name
levieggertcru Jul 16, 2024
cce117b
Set warning to 1
levieggertcru Jul 16, 2024
1d46813
Fix swift lint legacy_constructor
levieggertcru Jul 16, 2024
ef7acca
Update length
levieggertcru Jul 16, 2024
0f2f568
Make public
levieggertcru Jul 16, 2024
7a6b876
[skip ci] Adding latest localization files from OneSky
Jul 16, 2024
fa10d24
Merge pull request #2200 from CruGlobal/GT-2266-category-translation-bug
levieggertcru Jul 17, 2024
1837461
Merge pull request #2203 from CruGlobal/latest-onesky-translations
levieggertcru Jul 17, 2024
40c42a4
Merge pull request #2188 from CruGlobal/GT-swift-lint
levieggertcru Jul 17, 2024
38e50de
Including releases/* this way we can distribute a new release build a…
levieggertcru Jul 17, 2024
46ae1f0
Merge pull request #2206 from CruGlobal/GT-include-releases-branches-…
levieggertcru Jul 17, 2024
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
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
Loading