From 4a3369fb1a75a6bed4462cd4ec5cc97a39c18099 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Lapersonne Date: Mon, 14 Oct 2024 15:25:32 +0200 Subject: [PATCH] chore: update SwiftLint rules, remove SwftLint warnings, remove dead code (#143) (#195) Closes #143 Signed-off-by: Pierre-Yves Lapersonne --- .github/DEVELOP.md | 8 + .github/pull_request_template.md | 1 + .swiftlint.yml | 124 ++++++++----- CHANGELOG.md | 1 + .../Sources/Extensions/View+Shadows.swift | 3 +- .../OUDSTheme+ButtonsComponentTokens.swift | 5 + ...DSTheme+FormsTextInputComponentToken.swift | 41 ----- .../OUDS/Sources/OUDSTheme/OUDSTheme.swift | 2 + .../Sources/OUDSTheme/OUDSThemeableView.swift | 3 +- OUDS/Core/OUDS/Sources/_OUDS.docc/Themes.md | 22 +-- .../MockTheme+BorderSemanticTokens.swift | 2 +- .../MockTheme+ColorSemanticTokens.swift | 2 + .../MockTheme+ElevationSemanticTokens.swift | 2 +- .../MockTheme+GridSemanticTokens.swift | 2 +- .../MockTheme+SizingSemanticTokens.swift | 2 +- .../MockTheme+SpacingSemanticTokens.swift | 2 +- .../Tests/OUDSTheme/MockTheme/MockTheme.swift | 2 + ...tThemeOverrideOfBorderSemanticTokens.swift | 9 +- ...stThemeOverrideOfColorSemanticTokens.swift | 6 +- ...emeOverrideOfDimensionSemanticTokens.swift | 8 +- ...emeOverrideOfElevationSemanticTokens.swift | 10 +- ...estThemeOverrideOfGridSemanticTokens.swift | 8 +- ...ThemeOverrideOfOpacitySemanticTokens.swift | 8 +- ...tThemeOverrideOfSizingSemanticTokens.swift | 8 +- ...ThemeOverrideOfSpacingSemanticTokens.swift | 6 +- .../TestThemeOverrideOfThemeProperties.swift | 6 + ...meOverrideOfTypographySemanticTokens.swift | 6 +- .../InverseTheme+ColorSemanticTokens.swift | 164 +++++++++--------- ...InverseTheme+ElevationSemanticTokens.swift | 4 +- .../Themes/Inverse/Sources/InverseTheme.swift | 2 + .../Tests/TestInverseThemeColors.swift | 8 + .../Tests/TestInverseThemeElevation.swift | 8 +- .../OrangeTheme+SemanticColorTokens.swift | 13 +- .../Themes/Orange/Sources/OrangeTheme.swift | 2 + .../OrangeBrandColorRawTokens+Values.swift | 4 + .../OrangeBrandColorRawTokensTests.swift | 6 +- .../Values/ButtonsComponentTokens.swift | 4 + .../FormsTextInputComponentTokens.swift | 35 ---- .../ElevationCompositeRawToken.swift | 8 +- .../Values/BorderRawTokens+Values.swift | 4 + .../Values/ColorRawTokens+Values.swift | 4 + .../Values/DimensionRawTokens+Values.swift | 4 + .../ElevationRawTokens+Composites.swift | 4 + .../Values/ElevationRawTokens+Values.swift | 4 + .../Sources/Values/GridRawTokens+Values.swift | 6 +- .../Values/OpacityRawTokens+Values.swift | 4 + .../TypographyRawTokens+Composites.swift | 4 + .../Values/TypographyRawTokens+Values.swift | 14 +- .../Tests/BorderRawTokensTests.swift | 6 +- .../RawTokens/Tests/ColorRawTokensTests.swift | 4 +- .../Tests/DimensionRawTokensTests.swift | 6 +- .../Tests/ElevationRawTokensTests.swift | 6 +- .../RawTokens/Tests/GridRawTokensTests.swift | 6 +- .../Tests/OpacityRawTokensTests.swift | 6 +- .../Tests/TypographyRawTokensTests.swift | 4 +- .../Multiples/MultipleColorTokens.swift | 6 +- .../Multiples/MultipleElevationTokens.swift | 4 +- .../MultipleFontLetterSpacingTokens.swift | 8 +- .../MultipleFontLineHeightTokens.swift | 4 +- .../Multiples/MultipleFontSizeTokens.swift | 8 +- .../Multiples/MultipleSizingTokens.swift | 8 +- .../Multiples/MultipleSpacingTokens.swift | 4 +- .../Multiples/MultipleTypographyTokens.swift | 4 +- .../Sources/Values/BorderSemanticTokens.swift | 4 + .../Sources/Values/ColorSemanticTokens.swift | 4 + .../Values/DimensionSemanticTokens.swift | 4 + .../Values/ElevationSemanticTokens.swift | 4 + .../Sources/Values/GridSemanticTokens.swift | 4 + .../Values/OpacitySemanticTokens.swift | 5 +- .../Sources/Values/SizingSemanticTokens.swift | 4 + .../Values/SpacingSemanticTokens.swift | 4 + .../Values/TypographySemanticTokens.swift | 4 + .../MultipleColorSemanticTokenTests.swift | 6 +- .../MultipleElevationTokensTests.swift | 6 +- ...MultipleFontLetterSpacingTokensTests.swift | 5 +- .../MultipleFontLineHeightTokensTests.swift | 6 +- .../MultipleFontSizeTokensTests.swift | 6 +- .../MultipleSizingSemanticTokenTests.swift | 6 +- .../MultipleSpacingTokensTests.swift | 5 +- .../MultipleTypographyTokensTests.swift | 5 +- .../Sources/Extensions/String+SwiftUI.swift | 5 + OUDS/Foundations/Sources/OUDSLogger.swift | 11 ++ .../Extensions/TestColor+extensions.swift | 10 +- .../Extensions/TestFont+extensions.swift | 4 + .../Tests/Extensions/TestInt+SwiftUI.swift | 6 +- .../Tests/Extensions/TestString+SwiftUI.swift | 6 +- .../TestsUtils/XCTestCase+extensions.swift | 4 + OUDS/README.md | 22 +-- .../xcshareddata/swiftpm/Package.resolved | 2 +- Showcase/Showcase/OrangeCustomTheme.swift | 36 ++-- .../Pages/Components/ComponentsPage.swift | 4 +- .../Pages/Components/EmptyState.swift | 3 +- .../Pages/ThemeSelection/ThemeSelection.swift | 2 + .../Pages/Tokens/Border/BorderTokenPage.swift | 8 +- .../Dimension/Sizing/SizingTokenPage.swift | 6 + .../Dimension/Spacing/SpacingTokenPage.swift | 5 + .../Tokens/Elevation/ElevationTokenPage.swift | 3 +- .../Tokens/Opacity/OpacityTokenPage.swift | 8 +- .../Typography/TypographyTokenPage.swift | 5 + .../Pages/Utils/ShowcaseElementPage.swift | 3 +- .../Utils/ShowcaseTokenIllustration.swift | 6 +- .../Pages/Utils/ShowcaseVariantElement.swift | 4 + Showcase/Showcase/Utils/WebView.swift | 2 +- 103 files changed, 614 insertions(+), 322 deletions(-) delete mode 100644 OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+ComponentTokens/OUDSTheme+FormsTextInputComponentToken.swift delete mode 100644 OUDS/Core/Tokens/ComponentTokens/Sources/Values/FormsTextInputComponentTokens.swift diff --git a/.github/DEVELOP.md b/.github/DEVELOP.md index 8740f6303..c53f6301a 100644 --- a/.github/DEVELOP.md +++ b/.github/DEVELOP.md @@ -16,6 +16,7 @@ * [About release note](#about-release-note) * [About changelog](#about-changelog) - [Use of Gitleaks](#use-of-gitleaks) +- [Linter](#linter) - [CI/CD](#cicd) ## Technical preconditions @@ -463,6 +464,13 @@ Note that we face some issues about the use of _Gitleaks GitHub Action_ and _Git Remember _Gitleaks_ is also used in GitHub project side thanks to the [dedicated GitHub Action](https://github.com/marketplace/actions/gitleaks) but these controls are done online once commits have left the local environment. +## Linter + +We use _SwiftLint_ in this project so as to be sure the source code follows defined guidelines for the syntax and other points. +You must run _SwiftLint_ in CLI or using _Xcode_ to be sure you don't keep and submit warnings. +In most of cases you **must** fiw warnigns, but it could happen some of them should be disabled, mainly for tests cases. +Explain why in yout commtis and pull request comments you choose to disable them. + ## CI/CD We use GitLab CI for CI/CD with our own runners so as to keep private our sensitive files likes certificates and provisioning profiles. diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index b7b380cf3..81594d273 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -48,6 +48,7 @@ _Note: Please transform `- [ ]` into `- (NA)` in the description when things are #### Development - [ ] My change follows the [developer guide](https://github.com/Orange-OpenSource/ouds-ios/blob/develop/.github/DEVELOP.md) +- [ ] I checked my changes do not add new SwiftLint warnings - [ ] I have added unit tests to cover my changes _(optional)_ #### Documentation diff --git a/.swiftlint.yml b/.swiftlint.yml index 1ba81d288..f2c1098fb 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -12,7 +12,7 @@ # # More details at https://realm.github.io/SwiftLint -# Online validator at https://www.yamllint.com/ (beware of data you copy/paste) + # ======== # Included @@ -27,6 +27,7 @@ included: # ======== excluded: +- Showcase/Showcase/Info.plist - Showcase/Showcase/Resources - Showcase/Pods - Showcase/DerivedData @@ -38,14 +39,23 @@ strict: true # ============== disabled_rules: +- attributes +- conditional_returns_on_newline +- explicit_enum_raw_value - explicit_type_interface - extension_access_modifier -- identifier_name +- file_name +- file_types_order +- multiline_arguments_brackets +- multiline_parameters_brackets - opening_brace +- override_in_extension - strong_iboutlet - todo -- type_name +- type_contents_order - valid_ibinspectable +- vertical_whitespace_between_cases +- vertical_whitespace_opening_braces # ===================================== # Opt-in rules (not enabled by default) @@ -56,32 +66,27 @@ opt_in_rules: - accessibility_trait_for_button - anyobject_protocol - array_init -- attributes - closure_body_length - closure_end_indentation - closure_spacing - collection_alignment -- conditional_returns_on_newline - contains_over_first_not_nil -- convenience_type: - severity: error +- convenience_type - discouraged_object_literal - discouraged_optional_boolean - discouraged_optional_collection - empty_count - empty_string - empty_xctest_method -- explicit_enum_raw_value - explicit_init - explicit_self - fallthrough - fatal_error_message -- file_name -- file_types_order - first_where - force_unwrapping - function_default_parameter_at_end - identical_operands +- identifier_name - implicit_return - implicitly_unwrapped_optional - joined_default_parameter @@ -92,14 +97,10 @@ opt_in_rules: - literal_expression_end_indentation - missing_docs - modifier_order -- multiline_arguments: - severity: error -- multiline_arguments_brackets -- multiline_function_chains: - severity: error +- multiline_arguments +- multiline_function_chains - multiline_literal_brackets - multiline_parameters -- multiline_parameters_brackets - nimble_operator - no_extension_access_modifier - no_grouping_extension @@ -110,8 +111,7 @@ opt_in_rules: - operator_usage_whitespace - overridden_super_call - override_in_extension -- pattern_matching_keywords: - severity: error +- pattern_matching_keywords - prefixed_toplevel_constant - private_action - prohibited_super_call @@ -125,42 +125,40 @@ opt_in_rules: - sorted_first_last - sorted_imports - static_operator -- strict_fileprivate: - severity: error +- strict_fileprivate - strong_iboutlet - switch_case_alignment - switch_case_on_newline -- syntactic_sugar: - severity: error +- syntactic_sugar - toggle_bool -- trailing_closure: - only_single_muted_parameter: true -- trailing_newline: - severity: error +- trailing_closure +- trailing_newline - trailing_whitespace - type_body_length -- type_contents_order +- type_name - unavailable_function - unneeded_parentheses_in_closure_argument - unowned_variable_capture - untyped_error_in_catch - unused_import - unused_optional_binding -- vertical_parameter_alignment: - severity: error -- vertical_parameter_alignment_on_call: - severity: error -- vertical_whitespace_between_cases +- vertical_parameter_alignment +- vertical_parameter_alignment_on_call - vertical_whitespace_closing_braces -- vertical_whitespace_opening_braces -- weak_delegate: - severity: error +- weak_delegate - yoda_condition -# ================================ -# Other rules (enabled by default) -# ================================ +# ============= +# Rules details +# ============= +closure_body_length: + warning: 50 + error: 80 + +convenience_type: + severity: error + control_statement: severity: error @@ -187,6 +185,15 @@ function_parameter_count: implicit_getter: severity: error +identifier_name: + max_length: + warning: 60 + error: 80 + min_length: + warning: 1 + allowed_symbols: + - _ + large_tuple: warning: 3 error: 4 @@ -194,8 +201,47 @@ large_tuple: line_length: warning: 180 error: 200 + +multiline_arguments: + severity: error + +multiline_function_chains: + severity: error + +pattern_matching_keywords: + severity: error + +strict_fileprivate: + severity: error + +syntactic_sugar: + severity: error trailing_comma: - mandatory_comma: true + mandatory_comma: true +trailing_closure: + only_single_muted_parameter: true + +trailing_newline: + severity: error + type_body_length: 250 + +type_name: + max_length: + warning: 60 + error: 80 + min_length: + warning: 1 + allowed_symbols: + - _ + +vertical_parameter_alignment: + severity: error + +vertical_parameter_alignment_on_call: + severity: error + +weak_delegate: + severity: error diff --git a/CHANGELOG.md b/CHANGELOG.md index 105365ba9..43b2b471b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- [Library/DemoApp] Updates SwiftLint rules, fix linter warnings ([#143](https://github.com/Orange-OpenSource/ouds-ios/issues/143)) - [Tool] Update the templates for GitHub issues - [Tool] Improve script for documentation generation ([#168](https://github.com/Orange-OpenSource/ouds-ios/issues/168)) - [Library] Rename raw brand-specific color tokens in Orange theme (no use of "brand" word) ([#179](https://github.com/Orange-OpenSource/ouds-ios/issues/179)) diff --git a/OUDS/Core/Components/Sources/Extensions/View+Shadows.swift b/OUDS/Core/Components/Sources/Extensions/View+Shadows.swift index 0357bb784..d41cfd872 100644 --- a/OUDS/Core/Components/Sources/Extensions/View+Shadows.swift +++ b/OUDS/Core/Components/Sources/Extensions/View+Shadows.swift @@ -21,8 +21,7 @@ extension View { /// - Parameter elevation: The token to give for the shadow / elevation effect /// - Returns `View`: The current `View` with the shadow / elevation effect public func shadow(elevation: ElevationCompositeRawToken) -> some View { - return self - .shadow(color: elevation.color.color, + self.shadow(color: elevation.color.color, radius: elevation.radius, x: CGFloat(elevation.x), y: CGFloat(elevation.y)) diff --git a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+ComponentTokens/OUDSTheme+ButtonsComponentTokens.swift b/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+ComponentTokens/OUDSTheme+ButtonsComponentTokens.swift index 59d407801..625f17a36 100644 --- a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+ComponentTokens/OUDSTheme+ButtonsComponentTokens.swift +++ b/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+ComponentTokens/OUDSTheme+ButtonsComponentTokens.swift @@ -16,6 +16,9 @@ import OUDSTokensComponent import OUDSTokensRaw import OUDSTokensSemantic +// TODO: Check if we can get rid of alias colors tokens which are optional +// swiftlint:disable force_unwrapping + /// Defines for `OUDSButton` the basic configuration which can be overriden in subthemes / subclasses of this theme. /// **Warning: These are random and dumb values** extension OUDSTheme: ButtonsComponentTokens { @@ -35,3 +38,5 @@ extension OUDSTheme: ButtonsComponentTokens { @objc open var buttonTypography: MultipleTypographyTokens { typeDisplayMedium } } + +// swiftlint:enable force_unwrapping diff --git a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+ComponentTokens/OUDSTheme+FormsTextInputComponentToken.swift b/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+ComponentTokens/OUDSTheme+FormsTextInputComponentToken.swift deleted file mode 100644 index 7cf33ad1c..000000000 --- a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme+ComponentTokens/OUDSTheme+FormsTextInputComponentToken.swift +++ /dev/null @@ -1,41 +0,0 @@ -// -// Software Name: OUDS iOS -// SPDX-FileCopyrightText: Copyright (c) Orange SA -// SPDX-License-Identifier: MIT -// -// This software is distributed under the MIT license, -// the text of which is available at https://opensource.org/license/MIT/ -// or see the "LICENSE" file for more details. -// -// Authors: See CONTRIBUTORS.txt -// Software description: A SwiftUI components library with code examples for Orange Unified Design System -// - -import Foundation -import OUDSTokensComponent -import OUDSTokensRaw -import OUDSTokensSemantic - -/// Defines for `FormsTextInputComponentTokens` the basic configuration which can be overriden in subthemes / subclasses of this theme. -/// **Warning: These are random and dumb values** -extension OUDSTheme: FormsTextInputComponentTokens { - - // NOTE: What should we done if missing value? E.g. missing color or alias with empty values in the end - - @objc open var ftiTitleFontWeight: TypographyFontWeightSemanticToken { fontWeightHeading } - @objc open var ftiTitleFontSize: TypographyFontSizeSemanticToken { fontSizeLabelLarge } - - @objc open var ftiTitleColor: ColorSemanticToken { MultipleColorTokens(light: ColorRawTokens.colorFunctionalLightGray80, dark: ColorRawTokens.colorFunctionalDarkGray640) } - - @objc open var ftiSubtitleFontWeight: TypographyFontWeightSemanticToken { fontWeightDisplay } - @objc open var ftiSubtitleFontSize: TypographyFontSizeSemanticToken { fontSizeLabelMedium } - @objc open var ftiSubtitleColor: ColorSemanticToken { colorContentDefault! } - - @objc open var ftiBackgroundColor: ColorSemanticToken { colorBackgroundDefaultPrimary! } - - @objc open var ftiBorderColor: ColorSemanticToken { colorBorderEmphasized! } - - @objc open var ftiBorderStyle: BorderStyleSemanticToken { borderStyleDefault } - - @objc open var ftiBorderWidth: BorderWidthSemanticToken { borderWidthThin } -} diff --git a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme.swift b/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme.swift index 9548b86af..e6d36631a 100644 --- a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme.swift +++ b/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSTheme.swift @@ -40,5 +40,7 @@ open class OUDSTheme { self.customFontFamily = customFontFamily } + deinit { } + // Please refer to extensions for properties, it will be more clear } diff --git a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSThemeableView.swift b/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSThemeableView.swift index 67e280734..38337a475 100644 --- a/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSThemeableView.swift +++ b/OUDS/Core/OUDS/Sources/OUDSTheme/OUDSThemeableView.swift @@ -18,11 +18,12 @@ import SwiftUI private struct ThemeContractEnvironmentKey: EnvironmentKey { - static let defaultValue: OUDSTheme = OUDSTheme() + static let defaultValue = OUDSTheme() } extension EnvironmentValues { + /// The `OUDSTheme` instance exposed as en environment values across the library public var theme: OUDSTheme { get { self[ThemeContractEnvironmentKey.self] diff --git a/OUDS/Core/OUDS/Sources/_OUDS.docc/Themes.md b/OUDS/Core/OUDS/Sources/_OUDS.docc/Themes.md index 746d0915d..239d93462 100644 --- a/OUDS/Core/OUDS/Sources/_OUDS.docc/Themes.md +++ b/OUDS/Core/OUDS/Sources/_OUDS.docc/Themes.md @@ -71,22 +71,22 @@ class OrangeCustomTheme: OrangeTheme { } extension OrangeCustomTheme { // For FormsTextInputComponentTokens, used in component FormsTextInputComponent - public override var ftiTitleFontWeight: TypographyFontWeightSemanticToken { fontWeightLabelStrong } - public override var ftiTitleFontSize: TypographyFontSizeSemanticToken { fontSizeLabelXLarge } - public override var ftiTitleColor: ColorSemanticToken { ColorRawTokens.colorFunctionalDodgerBlue500 } + override public var ftiTitleFontWeight: TypographyFontWeightSemanticToken { fontWeightLabelStrong } + override public var ftiTitleFontSize: TypographyFontSizeSemanticToken { fontSizeLabelXLarge } + override public var ftiTitleColor: ColorSemanticToken { ColorRawTokens.colorFunctionalDodgerBlue500 } - public override var ftiSubtitleFontWeight: TypographyFontWeightSemanticToken { fontWeightBodyDefault } - public override var ftiSubtitleFontSize: TypographyFontSizeSemanticToken { fontSizeLabelMedium } - public override var ftiSubtitleColor: ColorSemanticToken { ColorRawTokens.colorFunctionalMalachite500 } + override public var ftiSubtitleFontWeight: TypographyFontWeightSemanticToken { fontWeightBodyDefault } + override public var ftiSubtitleFontSize: TypographyFontSizeSemanticToken { fontSizeLabelMedium } + override public var ftiSubtitleColor: ColorSemanticToken { ColorRawTokens.colorFunctionalMalachite500 } - public override var ftiBackgroundColorLight: ColorSemanticToken { colorBackgroundDefaultPrimaryLight } - public override var ftiBackgroundColorDark: ColorSemanticToken { colorBackgroundDefaultPrimaryDark } + override public var ftiBackgroundColorLight: ColorSemanticToken { colorBackgroundDefaultPrimaryLight } + override public var ftiBackgroundColorDark: ColorSemanticToken { colorBackgroundDefaultPrimaryDark } - public override var ftiBorderColor: ColorSemanticToken { colorBorderEmphasizedDark ?? MyThemeColorRawTokens.someAwesomeThemeExclusiveColor } + override public var ftiBorderColor: ColorSemanticToken { colorBorderEmphasizedDark ?? MyThemeColorRawTokens.someAwesomeThemeExclusiveColor } - public override var ftiBorderStyle: BorderStyleSemanticToken { borderStyleDrag } + override public var ftiBorderStyle: BorderStyleSemanticToken { borderStyleDrag } - public override var ftiBorderWidth: BorderWidthSemanticToken { borderWidthThick } + override public var ftiBorderWidth: BorderWidthSemanticToken { borderWidthThick } } extension OrangeCustomTheme { // For ColorSemanticTokens using anywhere diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+BorderSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+BorderSemanticTokens.swift index 514ebf6f9..aa90dd07d 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+BorderSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+BorderSemanticTokens.swift @@ -17,7 +17,7 @@ import OUDSTokensSemantic extension MockTheme { - static let mockThemeBorderWidthRawToken: BorderWidthRawToken = 1337 + static let mockThemeBorderWidthRawToken: BorderWidthRawToken = 1_337 static let mockThemeBorderRadiusRawToken: BorderRadiusRawToken = 42 static let mockThemeBorderStyleRawToken: BorderStyleRawToken = "(╯°□°)╯︵ ┻━┻" diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+ColorSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+ColorSemanticTokens.swift index 4d273ecb8..0f0304c42 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+ColorSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+ColorSemanticTokens.swift @@ -15,6 +15,7 @@ import Foundation import OUDSTokensRaw import OUDSTokensSemantic +// swiftlint:disable implicitly_unwrapped_optional extension MockTheme { static let mockThemeColorRawToken: ColorRawToken = "#68489D" @@ -330,3 +331,4 @@ extension MockTheme { // TODO: #124 - Add missing colorDecorativeSkin* // TODO: #124 - Add missing colorChart* } +// swiftlint:enable implicitly_unwrapped_optional diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+ElevationSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+ElevationSemanticTokens.swift index 6072519e1..f007466b3 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+ElevationSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+ElevationSemanticTokens.swift @@ -21,7 +21,7 @@ extension MockTheme { static let mockThemeElevationYRawToken: ElevationRawToken = 713 static let mockThemeElevationBlurRawToken: ElevationRawToken = 816 static let mockThemeElevationColorRawToken: ColorRawToken = ColorRawTokens.colorFunctionalMalachite500 - static let mockThemeElevationMultipleColorSemanticToken: ElevationColorSemanticToken = ElevationColorSemanticToken(mockThemeElevationColorRawToken) + static let mockThemeElevationMultipleColorSemanticToken = ElevationColorSemanticToken(mockThemeElevationColorRawToken) static let mockThemeElevationCompositeRawToken = ElevationCompositeRawToken(x: 118, y: 712, blur: 118, color: ColorRawTokens.colorFunctionalDodgerBlue800) static let mockThemeElevationCompositeSemanticToken = ElevationCompositeSemanticToken(ElevationRawTokens.elevationBottom_1_600) diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+GridSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+GridSemanticTokens.swift index eb782f8ad..36b142558 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+GridSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+GridSemanticTokens.swift @@ -17,7 +17,7 @@ import OUDSTokensSemantic extension MockTheme { - static let mockThemeGridRawToken: GridRawToken = 3630 + static let mockThemeGridRawToken: GridRawToken = 3_630 override var gridExtraCompactMinWidth: GridExtraCompactSemanticToken { Self.mockThemeGridRawToken } override var gridExtraCompactMaxWidth: GridExtraCompactSemanticToken { Self.mockThemeGridRawToken } diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+SizingSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+SizingSemanticTokens.swift index 41389dbda..7e464411a 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+SizingSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+SizingSemanticTokens.swift @@ -17,7 +17,7 @@ import OUDSTokensSemantic extension MockTheme { static let mockThemeSizeRawToken: DimensionRawToken = 118_000 - static let mockThemeSizeCompositeToken: MultipleSizingTokens = MultipleSizingTokens(compact: 1, regular: 151) + static let mockThemeSizeCompositeToken = MultipleSizingTokens(compact: 1, regular: 151) // MARK: - Semantic token - Sizing - Icon decorative diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+SpacingSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+SpacingSemanticTokens.swift index 21e26b67a..5e826f465 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+SpacingSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme+SpacingSemanticTokens.swift @@ -17,7 +17,7 @@ import OUDSTokensSemantic extension MockTheme { static let mockThemeSpaceRawToken: DimensionRawToken = 911 - static let mockThemeSpaceSemanticToken: MultipleSpacingTokens = MultipleSpacingTokens(compact: 1, regular: 151) + static let mockThemeSpaceSemanticToken = MultipleSpacingTokens(compact: 1, regular: 151) // MARK: Semantic token - Spacing - Layout fluid diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme.swift index fda7e8039..cb3d3d629 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/MockTheme/MockTheme.swift @@ -26,5 +26,7 @@ final class MockTheme: OUDSTheme { super.init(customFontFamily: customFont) } + deinit { } + // Please refer to extensions } diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfBorderSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfBorderSemanticTokens.swift index 4999f584f..1b696a1bf 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfBorderSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfBorderSemanticTokens.swift @@ -11,11 +11,15 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDS +import XCTest // WARNING: Maybe removed in the future or needs to be updated with token generation +// TODO: Check if we can get rid of alias colors tokens which are optional +// swiftlint:disable required_deinit +// swiftlint:disable implicitly_unwrapped_optional + /// The architecture of _OUDS iOS_ _Swift package_ library is based on _object oriented paradigm_ and overriding of classes. /// In fact the `OUDSTheme` object is a class, which can be seens as an _asbtract class_, exposing through its extensions and protocols _border semantic tokens_. /// These semantic tokens should be overriden by subclass like the `OrangeTheme` default theme. @@ -106,3 +110,6 @@ final class TestThemeOverrideOfBorderSemanticTokens: XCTestCase { XCTAssertTrue(inheritedTheme.borderStyleDrag == MockTheme.mockThemeBorderStyleRawToken) } } + +// swiftlint:enable required_deinit +// swiftlint:enable implicitly_unwrapped_optional diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfColorSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfColorSemanticTokens.swift index 4a3fd2037..e2ca679b5 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfColorSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfColorSemanticTokens.swift @@ -11,14 +11,16 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDS +import XCTest // WARNING: Maybe removed in the future or needs to be updated with token generation // swiftlint:disable type_body_length // swiftlint:disable line_length // swiftlint:disable file_length +// swiftlint:disable implicitly_unwrapped_optional +// swiftlint:disable required_deinit /// The architecture of _OUDS iOS_ _Swift package_ library is based on _object oriented paradigm_ and overriding of classes. /// In fact the `OUDSTheme` object is a class, which can be seen as an _asbtract class_, exposing through its extensions and protocols _colors semantic tokens_. @@ -1315,3 +1317,5 @@ final class TestThemeOverrideOfColorSemanticTokens: XCTestCase { // swiftlint:enable type_body_length // swiftlint:enable line_length +// swiftlint:enable implicitly_unwrapped_optional +// swiftlint:enable required_deinit diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfDimensionSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfDimensionSemanticTokens.swift index 98506dfc8..f543b3e5b 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfDimensionSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfDimensionSemanticTokens.swift @@ -11,11 +11,14 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDS +import XCTest // WARNING: Maybe removed in the future or needs to be updated with token generation +// swiftlint:disable implicitly_unwrapped_optional +// swiftlint:disable required_deinit + /// The architecture of _OUDS iOS_ _Swift package_ library is based on _object oriented paradigm_ and overriding of classes. /// In fact the `OUDSTheme` object is a class, which can be seen as an _asbtract class_, exposing through its extensions and protocols _dimension semantic tokens_. /// These semantic tokens should be overriden by subclass like the `OrangeTheme` default theme. @@ -155,3 +158,6 @@ final class TestThemeOverrideOfDimensionSemanticTokens: XCTestCase { XCTAssertTrue(inheritedTheme.dimension11XL == MockTheme.mockThemeDimensionSemanticToken) } } + +// swiftlint:enable implicitly_unwrapped_optional +// swiftlint:enable required_deinit diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfElevationSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfElevationSemanticTokens.swift index 933b2bfc6..5314abab8 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfElevationSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfElevationSemanticTokens.swift @@ -11,11 +11,14 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDS +import XCTest // WARNING: Maybe removed in the future or needs to be updated with token generation +// swiftlint:disable required_deinit +// swiftlint:disable implicitly_unwrapped_optional + /// The architecture of _OUDS iOS_ _Swift package_ library is based on _object oriented paradigm_ and overriding of classes. /// In fact, the `OUDSTheme` object is a class, which can be seen as an _asbtract class_, exposing through its extensions and protocols _elevation semantic tokens_. /// These semantic tokens should be overriden by subclass like the `OrangeTheme` default theme. @@ -240,7 +243,7 @@ final class TestThemeOverrideOfElevationSemanticTokens: XCTestCase { func testInheritedThemeCanOverrideSemanticTokenElevationCompositeStickyDefault() throws { XCTAssertNotEqual(inheritedTheme.elevationStickyDefault, abstractTheme.elevationStickyDefault) - XCTAssertTrue(inheritedTheme.elevationStickyDefault == MockTheme.mockThemeElevationCompositeSemanticToken) + XCTAssertTrue(inheritedTheme.elevationStickyDefault == MockTheme.mockThemeElevationCompositeSemanticToken) } func testInheritedThemeCanOverrideSemanticTokenElevationCompositeStickyEmphasized() throws { @@ -258,3 +261,6 @@ final class TestThemeOverrideOfElevationSemanticTokens: XCTestCase { XCTAssertTrue(inheritedTheme.elevationFocus == MockTheme.mockThemeElevationCompositeSemanticToken) } } + +// swiftlint:enable required_deinit +// swiftlint:enable implicitly_unwrapped_optional diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfGridSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfGridSemanticTokens.swift index 2c65ed789..cef7f9d65 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfGridSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfGridSemanticTokens.swift @@ -11,8 +11,11 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDS +import XCTest + +// swiftlint:disable required_deinit +// swiftlint:disable implicitly_unwrapped_optional // WARNING: Maybe removed in the future or needs to be updated with token generation @@ -105,3 +108,6 @@ final class TestThemeOverrideOfGridSemanticTokens: XCTestCase { XCTAssertTrue(inheritedTheme.gridRegularColumnCount == MockTheme.mockThemeGridRawToken) } } + +// swiftlint:enable required_deinit +// swiftlint:enable implicitly_unwrapped_optional diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfOpacitySemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfOpacitySemanticTokens.swift index fae785e90..0afbe3484 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfOpacitySemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfOpacitySemanticTokens.swift @@ -11,8 +11,11 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDS +import XCTest + +// swiftlint:disable required_deinit +// swiftlint:disable implicitly_unwrapped_optional // WARNING: Maybe removed in the future or needs to be updated with token generation @@ -60,3 +63,6 @@ final class TestThemeOverrideOfOpacitySemanticTokens: XCTestCase { XCTAssertTrue(inheritedTheme.opacityOpaque == MockTheme.mockThemeOpacityRawToken) } } + +// swiftlint:enable required_deinit +// swiftlint:enable implicitly_unwrapped_optional diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfSizingSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfSizingSemanticTokens.swift index c52489ec3..0261be540 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfSizingSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfSizingSemanticTokens.swift @@ -11,11 +11,14 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDS +import XCTest // WARNING: Maybe removed in the future or needs to be updated with token generation +// swiftlint:disable required_deinit +// swiftlint:disable implicitly_unwrapped_optional + /// The architecture of _OUDS iOS_ _Swift package_ library is based on _object oriented paradigm_ and overriding of classes. /// In fact the `OUDSTheme` object is a class, which can be seen as an _asbtract class_, exposing through its extensions and protocols _sizing semantic tokens_. /// These semantic tokens should be overriden by subclass like the `OrangeTheme` default theme. @@ -296,3 +299,6 @@ final class TestThemeOverrideOfSizingSemanticTokens: XCTestCase { XCTAssertTrue(inheritedTheme.sizeMaxWidthTypeBodyLarge.isEqual(MockTheme.mockThemeSizeCompositeToken)) } } + +// swiftlint:enable required_deinit +// swiftlint:enable implicitly_unwrapped_optional diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfSpacingSemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfSpacingSemanticTokens.swift index 9f7d8145d..dc5d8caa1 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfSpacingSemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfSpacingSemanticTokens.swift @@ -11,12 +11,14 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDS +import XCTest // WARNING: Maybe removed in the future or needs to be updated with token generation // swiftlint:disable type_body_length +// swiftlint:disable required_deinit +// swiftlint:disable implicitly_unwrapped_optional /// The architecture of _OUDS iOS_ _Swift package_ library is based on _object oriented paradigm_ and overriding of classes. /// In factn the `OUDSTheme` object is a class, which can be seens as an _asbtract class_, exposing through its extensions and protocols _spacing semantic tokens_. @@ -522,4 +524,6 @@ final class TestThemeOverrideOfSpacingSemanticTokens: XCTestCase { } } +// swiftlint:enable required_deinit +// swiftlint:enable implicitly_unwrapped_optional // swiftlint:enable type_body_length diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfThemeProperties.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfThemeProperties.swift index 28a18e25e..a984d0d08 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfThemeProperties.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfThemeProperties.swift @@ -16,6 +16,9 @@ import XCTest // WARNING: Maybe removed in the future or needs to be updated with token generation +// swiftlint:disable required_deinit +// swiftlint:disable implicitly_unwrapped_optional + /// The architecture of _OUDS iOS_ _Swift package_ library is based on _object oriented paradigm_ and overriding of classes. /// In fact the `OUDSTheme` object is a class, which can be seen as an _asbtract class_, exposing through its extensions and protocols some properties. /// These properties should be overridable by subclasses like the `OrangeTheme` default theme. @@ -35,3 +38,6 @@ final class TestThemeOverrideOfThemeProperties: XCTestCase { XCTAssertTrue(inheritedTheme.customFontFamily == "Mr R08øT") } } + +// swiftlint:enable required_deinit +// swiftlint:enable implicitly_unwrapped_optional diff --git a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfTypographySemanticTokens.swift b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfTypographySemanticTokens.swift index 70768c39e..0728fbf55 100644 --- a/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfTypographySemanticTokens.swift +++ b/OUDS/Core/OUDS/Tests/OUDSTheme/TestThemeOverrideOfTypographySemanticTokens.swift @@ -11,12 +11,14 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDS +import XCTest // WARNING: Maybe removed in the future or needs to be updated with token generation // swiftlint:disable type_body_length +// swiftlint:disable required_deinit +// swiftlint:disable implicitly_unwrapped_optional /// The architecture of _OUDS iOS_ _Swift package_ library is based on _object oriented paradigm_ and overriding of classes. /// In fact the `OUDSTheme` object is a class, which can be seen as an _asbtract class_, exposing through its extensions and protocols _typography semantic tokens_. @@ -475,4 +477,6 @@ final class TestThemeOverrideOfTypographySemanticTokens: XCTestCase { } } +// swiftlint:enable required_deinit +// swiftlint:enable implicitly_unwrapped_optional // swiftlint:enable type_body_length diff --git a/OUDS/Core/Themes/Inverse/Sources/InverseTheme+ColorSemanticTokens.swift b/OUDS/Core/Themes/Inverse/Sources/InverseTheme+ColorSemanticTokens.swift index c038bc290..a85485fbc 100644 --- a/OUDS/Core/Themes/Inverse/Sources/InverseTheme+ColorSemanticTokens.swift +++ b/OUDS/Core/Themes/Inverse/Sources/InverseTheme+ColorSemanticTokens.swift @@ -18,96 +18,99 @@ import OUDSTokensSemantic // [File to generate with the tokenator] // WARNING: Not synchronized anymore with the Figjam +// TODO: See if we can get rid of color aliases tokens providing optional values +// swiftlint:disable force_unwrapping + /// Overrides some colors using values defined in extension of `ColorRawTokens` in this current module. extension InverseTheme { - public override var colorBackgroundDefaultPrimary: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedHighest!) } + override public var colorBackgroundDefaultPrimary: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedHighest!) } - public override var colorBackgroundDefaultSecondary: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedHigh!) } + override public var colorBackgroundDefaultSecondary: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedHigh!) } - public override var colorBackgroundDefaultTertiary: ColorSemanticToken? { MultipleColorTokens(sysColorBrandAttractiveHighest!) } + override public var colorBackgroundDefaultTertiary: ColorSemanticToken? { MultipleColorTokens(sysColorBrandAttractiveHighest!) } - public override var colorBackgroundEmphasizedPrimary: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedWhite!) } + override public var colorBackgroundEmphasizedPrimary: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedWhite!) } - public override var colorBackgroundBrandPrimary: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryLow!) } + override public var colorBackgroundBrandPrimary: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryLow!) } - public override var colorBackgroundStatusNeutral: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedHigh!) } + override public var colorBackgroundStatusNeutral: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedHigh!) } - public override var colorBackgroundStatusNeutralOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLowest) } + override public var colorBackgroundStatusNeutralOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLowest) } - public override var colorBackgroundStatusAttractiveMuted: ColorSemanticToken? { MultipleColorTokens(sysColorBrandAttractiveLowest!) } + override public var colorBackgroundStatusAttractiveMuted: ColorSemanticToken? { MultipleColorTokens(sysColorBrandAttractiveLowest!) } - public override var colorBackgroundStatusAttractiveEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandWarningDefault!) } + override public var colorBackgroundStatusAttractiveEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandWarningDefault!) } - public override var colorBackgroundStatusWarningMuted: ColorSemanticToken? { MultipleColorTokens(sysColorBrandWarningHighest!) } + override public var colorBackgroundStatusWarningMuted: ColorSemanticToken? { MultipleColorTokens(sysColorBrandWarningHighest!) } - public override var colorBackgroundStatusWarningMutedOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandWarningLowest) } + override public var colorBackgroundStatusWarningMutedOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandWarningLowest) } - public override var colorBackgroundStatusWarningEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandWarningDefault!) } + override public var colorBackgroundStatusWarningEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandWarningDefault!) } - public override var colorBackgroundStatusNegativeMuted: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedHighest!) } + override public var colorBackgroundStatusNegativeMuted: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedHighest!) } - public override var colorBackgroundStatusNegativeMutedOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNegativeLowest) } + override public var colorBackgroundStatusNegativeMutedOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNegativeLowest) } - public override var colorBackgroundStatusNegativeEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNegativeDefault!) } + override public var colorBackgroundStatusNegativeEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNegativeDefault!) } - public override var colorBackgroundStatusPositiveMuted: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPositiveHighest!) } + override public var colorBackgroundStatusPositiveMuted: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPositiveHighest!) } - public override var colorBackgroundStatusPositiveMutedOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPositiveLowest) } + override public var colorBackgroundStatusPositiveMutedOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPositiveLowest) } - public override var colorBackgroundStatusPositiveEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPositiveDefault!) } + override public var colorBackgroundStatusPositiveEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPositiveDefault!) } - public override var colorBackgroundStatusInformationMuted: ColorSemanticToken? { MultipleColorTokens(sysColorBrandInformationLowest!) } + override public var colorBackgroundStatusInformationMuted: ColorSemanticToken? { MultipleColorTokens(sysColorBrandInformationLowest!) } - public override var colorBackgroundStatusInformationMutedOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandInformationLowest) } + override public var colorBackgroundStatusInformationMutedOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandInformationLowest) } - public override var colorBackgroundStatusInformationEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPositiveLowest!) } + override public var colorBackgroundStatusInformationEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPositiveLowest!) } - public override var colorContentDefault: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedWhite!) } + override public var colorContentDefault: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedWhite!) } - public override var colorContentDefaultOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack!) } + override public var colorContentDefaultOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack!) } - public override var colorContentDefaultOnBackgroundBrandPrimary: ColorSemanticToken! { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack!) } + override public var colorContentDefaultOnBackgroundBrandPrimary: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack!) } - public override var colorContentMuted: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedMedium!) } + override public var colorContentMuted: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedMedium!) } - public override var colorContentMutedOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLowest!) } + override public var colorContentMutedOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLowest!) } - public override var colorContentDisabled: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLowest!) } + override public var colorContentDisabled: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLowest!) } - public override var colorContentDisabledOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedMedium!) } + override public var colorContentDisabledOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedMedium!) } - public override var colorContentBrandPrimary: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryLow!) } + override public var colorContentBrandPrimary: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryLow!) } - public override var colorContentBrandPrimaryOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryDefault!) } + override public var colorContentBrandPrimaryOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryDefault!) } - public override var colorContentBrandSecondary: ColorSemanticToken? { nil } + override public var colorContentBrandSecondary: ColorSemanticToken? { nil } - public override var colorContentBrandTertiary: ColorSemanticToken? { nil } + override public var colorContentBrandTertiary: ColorSemanticToken? { nil } - public override var colorContentStatusAttractive: ColorSemanticToken? { nil } + override public var colorContentStatusAttractive: ColorSemanticToken? { nil } - public override var colorContentStatusNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNegativeDefault!) } + override public var colorContentStatusNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNegativeDefault!) } - public override var colorContentStatusPositive: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPositiveDefault!) } + override public var colorContentStatusPositive: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPositiveDefault!) } - public override var colorContentStatusInformation: ColorSemanticToken? { MultipleColorTokens(sysColorBrandInformationDefault!) } + override public var colorContentStatusInformation: ColorSemanticToken? { MultipleColorTokens(sysColorBrandInformationDefault!) } - public override var colorContentActionEnabled: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedLower) } + override public var colorContentActionEnabled: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedLower) } - public override var colorContentActionEnabledOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack) } + override public var colorContentActionEnabledOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack) } - public override var colorContentActionEnabledOnBackgroundStatusExcNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack) } + override public var colorContentActionEnabledOnBackgroundStatusExcNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack) } - public override var colorContentActionEnabledOnBackgroundStatusNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedWhite) } + override public var colorContentActionEnabledOnBackgroundStatusNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedWhite) } - public override var colorContentActionHover: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedMedium) } + override public var colorContentActionHover: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedMedium) } - public override var colorContentActionHoverOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLowest) } + override public var colorContentActionHoverOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLowest) } - public override var colorContentActionHoverOnBackgroundStatusExcNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLow) } + override public var colorContentActionHoverOnBackgroundStatusExcNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLow) } - public override var colorContentActionHoverOnBackgroundStatusNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack) } + override public var colorContentActionHoverOnBackgroundStatusNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack) } // TODO: #124 - Add missing colorContentActionPressed* tokens // TODO: #124 - Add missing colorContentActionDisabled* tokens @@ -120,81 +123,81 @@ extension InverseTheme { // TODO: #124 - Add missing colorContentActionSelectionUnselected* tokens // TODO: #124 - Add missing colorContentActionAlways* tokens - public override var colorBorderDefault: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLowest!) } + override public var colorBorderDefault: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLowest!) } // TODO: #124 - Add missing colorBorderDefaultOnBackgroundBrandPrimary // TODO: #124 - Add missing colorBorderDefaultOnBackgroundBrandSecondary // TODO: #124 - Add missing colorBorderDefaultOnBackgroundBrandTertiary - public override var colorBorderDefaultOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedMedium!) } + override public var colorBorderDefaultOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedMedium!) } - public override var colorBorderEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedWhite!) } + override public var colorBorderEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedWhite!) } - public override var colorBorderEmphasizedOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack!) } + override public var colorBorderEmphasizedOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack!) } - public override var colorBorderBrandPrimary: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryLow!) } + override public var colorBorderBrandPrimary: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryLow!) } - public override var colorBorderBrandPrimaryOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryDefault!) } + override public var colorBorderBrandPrimaryOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryDefault!) } - public override var colorBorderBrandSecondary: ColorSemanticToken? { nil } + override public var colorBorderBrandSecondary: ColorSemanticToken? { nil } - public override var colorBorderBrandTertiary: ColorSemanticToken? { nil } + override public var colorBorderBrandTertiary: ColorSemanticToken? { nil } - public override var colorBorderBrandStatusAttractive: ColorSemanticToken? { nil } + override public var colorBorderBrandStatusAttractive: ColorSemanticToken? { nil } - public override var colorBorderBrandStatusWarning: ColorSemanticToken? { nil } + override public var colorBorderBrandStatusWarning: ColorSemanticToken? { nil } - public override var colorBorderBrandStatusNegative: ColorSemanticToken? { nil } + override public var colorBorderBrandStatusNegative: ColorSemanticToken? { nil } - public override var colorBorderBrandStatusPositive: ColorSemanticToken? { nil } + override public var colorBorderBrandStatusPositive: ColorSemanticToken? { nil } - public override var colorBorderBrandStatusInformation: ColorSemanticToken? { nil } + override public var colorBorderBrandStatusInformation: ColorSemanticToken? { nil } - public override var colorBackgroundActionEnabled: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedLower) } + override public var colorBackgroundActionEnabled: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedLower) } - public override var colorBackgroundActionEnabledOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack) } + override public var colorBackgroundActionEnabledOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack) } - public override var colorBackgroundActionEnabledOnBackgroundStatusExcNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack) } + override public var colorBackgroundActionEnabledOnBackgroundStatusExcNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack) } - public override var colorBackgroundActionEnabledOnBackgroundStatusNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedWhite) } + override public var colorBackgroundActionEnabledOnBackgroundStatusNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedWhite) } - public override var colorBackgroundActionPressed: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryLow) } + override public var colorBackgroundActionPressed: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryLow) } - public override var colorBackgroundActionPressedOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryDefault) } + override public var colorBackgroundActionPressedOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryDefault) } - public override var colorBackgroundActionPressedOnBackgroundStatusExcNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryDefault) } + override public var colorBackgroundActionPressedOnBackgroundStatusExcNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryDefault) } - public override var colorBackgroundActionPressedOnBackgroundStautsNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryDefault) } + override public var colorBackgroundActionPressedOnBackgroundStautsNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPrimaryDefault) } - public override var colorBackgroundActionDisabled: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLowest) } + override public var colorBackgroundActionDisabled: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLowest) } - public override var colorBackgroundActionDisabledOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedMedium) } + override public var colorBackgroundActionDisabledOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedMedium) } - public override var colorBackgroundActionDisabledOnBackgroundStatusExcNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedMedium) } + override public var colorBackgroundActionDisabledOnBackgroundStatusExcNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedMedium) } - public override var colorBackgroundActionDisabledOnBackgroundStatusNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLowest) } + override public var colorBackgroundActionDisabledOnBackgroundStatusNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLowest) } - public override var colorBackgroundActionFocus: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedMedium) } + override public var colorBackgroundActionFocus: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedMedium) } - public override var colorBackgroundActionFocusOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedMedium) } + override public var colorBackgroundActionFocusOnBackgroundEmphasized: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedMedium) } - public override var colorBackgroundActionFocusOnBackgroundStatusExcNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLow) } + override public var colorBackgroundActionFocusOnBackgroundStatusExcNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedLow) } - public override var colorBackgroundActionFocusOnBackgroundStatusNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack) } + override public var colorBackgroundActionFocusOnBackgroundStatusNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack) } - public override var colorBackgroundAlwaysBlack: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack) } + override public var colorBackgroundAlwaysBlack: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralEmphasizedBlack) } - public override var colorBackgroundAlwaysWhite: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedWhite) } + override public var colorBackgroundAlwaysWhite: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNeutralMutedWhite) } - public override var colorBackgroundAlwaysAttractive: ColorSemanticToken? { MultipleColorTokens(sysColorBrandWarningDefault) } + override public var colorBackgroundAlwaysAttractive: ColorSemanticToken? { MultipleColorTokens(sysColorBrandWarningDefault) } - public override var colorBackgroundAlwaysWarning: ColorSemanticToken? { MultipleColorTokens(sysColorBrandWarningDefault) } + override public var colorBackgroundAlwaysWarning: ColorSemanticToken? { MultipleColorTokens(sysColorBrandWarningDefault) } - public override var colorBackgroundAlwaysNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNegativeDefault) } + override public var colorBackgroundAlwaysNegative: ColorSemanticToken? { MultipleColorTokens(sysColorBrandNegativeDefault) } - public override var colorBackgroundAlwaysPositive: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPositiveDefault) } + override public var colorBackgroundAlwaysPositive: ColorSemanticToken? { MultipleColorTokens(sysColorBrandPositiveDefault) } - public override var colorBackgroundAlwaysInformation: ColorSemanticToken? { MultipleColorTokens(sysColorBrandInformationDefault) } + override public var colorBackgroundAlwaysInformation: ColorSemanticToken? { MultipleColorTokens(sysColorBrandInformationDefault) } // TODO: #124 - Add missing colorBorderActionEnabled* // TODO: #124 - Add missing colorBorderActionHover* @@ -223,3 +226,4 @@ extension InverseTheme { // TODO: #124 - Add missing colorDecorativeSkin* // TODO: #124 - Add missing colorChart* } +// swiftlint:enable force_unwrapping diff --git a/OUDS/Core/Themes/Inverse/Sources/InverseTheme+ElevationSemanticTokens.swift b/OUDS/Core/Themes/Inverse/Sources/InverseTheme+ElevationSemanticTokens.swift index 26591de27..761572b8e 100644 --- a/OUDS/Core/Themes/Inverse/Sources/InverseTheme+ElevationSemanticTokens.swift +++ b/OUDS/Core/Themes/Inverse/Sources/InverseTheme+ElevationSemanticTokens.swift @@ -24,11 +24,11 @@ extension InverseTheme { // MARK: Semantic token - Elevation - Color - Focus - public override var elevationColorFocus: ElevationColorSemanticToken { MultipleColorTokens( ColorRawTokens.colorFunctionalLightGray160) } + override public var elevationColorFocus: ElevationColorSemanticToken { MultipleColorTokens( ColorRawTokens.colorFunctionalLightGray160) } // MARK: Semantic token - Elevation - Box shadow - public override var elevationFocus: ElevationCompositeSemanticToken { ElevationCompositeSemanticToken(light: ElevationCompositeRawToken(x: 0, y: 0, blur: 0, color: ColorRawTokens.colorFunctionalLightGray160), dark: ElevationCompositeRawToken(x: 0, y: 0, blur: 0, color: ColorRawTokens.colorFunctionalLightGray160)) } + override public var elevationFocus: ElevationCompositeSemanticToken { ElevationCompositeSemanticToken(light: ElevationCompositeRawToken(x: 0, y: 0, blur: 0, color: ColorRawTokens.colorFunctionalLightGray160), dark: ElevationCompositeRawToken(x: 0, y: 0, blur: 0, color: ColorRawTokens.colorFunctionalLightGray160)) } } // swiftlint:enable line_length diff --git a/OUDS/Core/Themes/Inverse/Sources/InverseTheme.swift b/OUDS/Core/Themes/Inverse/Sources/InverseTheme.swift index bb02464d6..9d29962ef 100644 --- a/OUDS/Core/Themes/Inverse/Sources/InverseTheme.swift +++ b/OUDS/Core/Themes/Inverse/Sources/InverseTheme.swift @@ -17,5 +17,7 @@ import OUDSThemesOrange /// It can overrides any properties from its superclass, and can be derived too. open class InverseTheme: OrangeTheme { + deinit { } + // For clarity reasons, please override OUDSTheme properties in extensions } diff --git a/OUDS/Core/Themes/Inverse/Tests/TestInverseThemeColors.swift b/OUDS/Core/Themes/Inverse/Tests/TestInverseThemeColors.swift index 11d8cdf3c..9fb3f6785 100644 --- a/OUDS/Core/Themes/Inverse/Tests/TestInverseThemeColors.swift +++ b/OUDS/Core/Themes/Inverse/Tests/TestInverseThemeColors.swift @@ -16,6 +16,10 @@ import OUDSThemesInverse import OUDSTokensSemantic import XCTest +// swiftlint:disable required_deinit +// swiftlint:disable implicitly_unwrapped_optional +// swiftlint:disable force_unwrapping + /// `InverseTheme` is a quite particular theme with "inverse" color palette. Is it neuther a light mode theme nor a dark mode theme. /// This "inverse" mode as colors which, for a given semantic token, has the same value for both light and dark mode. final class TestInverseThemeColors: XCTestCase { @@ -346,3 +350,7 @@ final class TestInverseThemeColors: XCTestCase { // TODO: #124 - Add missing colorDecorativeSkin* // TODO: #124 - Add missing colorChart* } + +// swiftlint:enable required_deinit +// swiftlint:enable implicitly_unwrapped_optional +// swiftlint:enable force_unwrapping diff --git a/OUDS/Core/Themes/Inverse/Tests/TestInverseThemeElevation.swift b/OUDS/Core/Themes/Inverse/Tests/TestInverseThemeElevation.swift index c9f9e3e23..6262cb9af 100644 --- a/OUDS/Core/Themes/Inverse/Tests/TestInverseThemeElevation.swift +++ b/OUDS/Core/Themes/Inverse/Tests/TestInverseThemeElevation.swift @@ -11,9 +11,12 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDS import OUDSThemesInverse +import XCTest + +// swiftlint:disable required_deinit +// swiftlint:disable implicitly_unwrapped_optional /// `InverseTheme` is a quite particular theme with "inverse" color palette. Is it neuther a light mode theme nor a dark mode theme. /// This "inverse" mode as colors which, for a given semantic token, has the same value for both light and dark mode. @@ -41,3 +44,6 @@ final class TestInverseThemeElevationColors: XCTestCase { XCTAssertEqual(inverseTheme.elevationFocus.light, inverseTheme.elevationFocus.dark) } } + +// swiftlint:enable required_deinit +// swiftlint:enable implicitly_unwrapped_optional diff --git a/OUDS/Core/Themes/Orange/Sources/OrangeTheme+SemanticColorTokens.swift b/OUDS/Core/Themes/Orange/Sources/OrangeTheme+SemanticColorTokens.swift index 8d7dd777b..33b858bd5 100644 --- a/OUDS/Core/Themes/Orange/Sources/OrangeTheme+SemanticColorTokens.swift +++ b/OUDS/Core/Themes/Orange/Sources/OrangeTheme+SemanticColorTokens.swift @@ -17,12 +17,17 @@ import OUDSTokensSemantic // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// TODO: Check if we can get rid of alias colors tokens which are optional +// swiftlint:disable implicitly_unwrapped_optional + /// Overrides some colors using values defined in extension of `ColorRawTokens` in this current module. extension OrangeTheme { - public override var sysColorBrandPrimaryLow: ColorAliasSemanticToken! { OrangeBrandColorRawTokens.colorOrange500 } - public override var sysColorBrandPrimaryDefault: ColorAliasSemanticToken! { OrangeBrandColorRawTokens.colorOrange550 } + override public var sysColorBrandPrimaryLow: ColorAliasSemanticToken! { OrangeBrandColorRawTokens.colorOrange500 } + override public var sysColorBrandPrimaryDefault: ColorAliasSemanticToken! { OrangeBrandColorRawTokens.colorOrange550 } - public override var sysColorBrandAttractiveLowest: ColorAliasSemanticToken! { OrangeBrandColorRawTokens.colorWarmGray100 } - public override var sysColorBrandAttractiveHighest: ColorAliasSemanticToken! { OrangeBrandColorRawTokens.colorWarmGray900 } + override public var sysColorBrandAttractiveLowest: ColorAliasSemanticToken! { OrangeBrandColorRawTokens.colorWarmGray100 } + override public var sysColorBrandAttractiveHighest: ColorAliasSemanticToken! { OrangeBrandColorRawTokens.colorWarmGray900 } } + +// swiftlint:enable implicitly_unwrapped_optional diff --git a/OUDS/Core/Themes/Orange/Sources/OrangeTheme.swift b/OUDS/Core/Themes/Orange/Sources/OrangeTheme.swift index ab15e574a..371c1a3dc 100644 --- a/OUDS/Core/Themes/Orange/Sources/OrangeTheme.swift +++ b/OUDS/Core/Themes/Orange/Sources/OrangeTheme.swift @@ -17,5 +17,7 @@ import OUDS /// It can overrides any properties from its superclass, and can be derived too. open class OrangeTheme: OUDSTheme { + deinit { } + // For clarity reasons, please override OUDSTheme properties in extensions } diff --git a/OUDS/Core/Themes/Orange/Sources/Values/OrangeBrandColorRawTokens+Values.swift b/OUDS/Core/Themes/Orange/Sources/Values/OrangeBrandColorRawTokens+Values.swift index 11cfda1a9..7b5ae9957 100644 --- a/OUDS/Core/Themes/Orange/Sources/Values/OrangeBrandColorRawTokens+Values.swift +++ b/OUDS/Core/Themes/Orange/Sources/Values/OrangeBrandColorRawTokens+Values.swift @@ -16,6 +16,8 @@ import OUDSTokensRaw // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + extension OrangeBrandColorRawTokens { // MARK: Primitive token - Colors - Orange - Orange @@ -44,3 +46,5 @@ extension OrangeBrandColorRawTokens { public static let colorWarmGray800: ColorOrangeBrandRawToken = "#48433D" public static let colorWarmGray900: ColorOrangeBrandRawToken = "#353228" } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Themes/Orange/Tests/OrangeBrandColorRawTokensTests.swift b/OUDS/Core/Themes/Orange/Tests/OrangeBrandColorRawTokensTests.swift index 66aa2e807..e27243b7a 100644 --- a/OUDS/Core/Themes/Orange/Tests/OrangeBrandColorRawTokensTests.swift +++ b/OUDS/Core/Themes/Orange/Tests/OrangeBrandColorRawTokensTests.swift @@ -11,9 +11,11 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDSThemesOrange import TestsUtils +import XCTest + +// swiftlint:disable required_deinit /// The aim of this tests class is to look for regressions in **Orange brand color raw tokens**. /// Because these values will be at least generated through an external tool, is it not relevant to test each token values. @@ -98,3 +100,5 @@ final class OrangeBrandColorRawTokensTests: XCTestCase { XCTAssertColorLighterThan(OrangeBrandColorRawTokens.colorWarmGray800, OrangeBrandColorRawTokens.colorWarmGray900) } } + +// swiftlint:enable required_deinit diff --git a/OUDS/Core/Tokens/ComponentTokens/Sources/Values/ButtonsComponentTokens.swift b/OUDS/Core/Tokens/ComponentTokens/Sources/Values/ButtonsComponentTokens.swift index 22800bb86..af095e648 100644 --- a/OUDS/Core/Tokens/ComponentTokens/Sources/Values/ButtonsComponentTokens.swift +++ b/OUDS/Core/Tokens/ComponentTokens/Sources/Values/ButtonsComponentTokens.swift @@ -13,6 +13,8 @@ import OUDSTokensSemantic +// swiftlint:disable missing_docs + /// This is a component tokens list for buttons like `OUDSButton`. /// **Warning: This is a draft component ** public protocol ButtonsComponentTokens { @@ -38,3 +40,5 @@ public protocol ButtonsComponentTokens { var buttonTypography: MultipleTypographyTokens { get } } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/ComponentTokens/Sources/Values/FormsTextInputComponentTokens.swift b/OUDS/Core/Tokens/ComponentTokens/Sources/Values/FormsTextInputComponentTokens.swift deleted file mode 100644 index 9eb5896d2..000000000 --- a/OUDS/Core/Tokens/ComponentTokens/Sources/Values/FormsTextInputComponentTokens.swift +++ /dev/null @@ -1,35 +0,0 @@ -// -// Software Name: OUDS iOS -// SPDX-FileCopyrightText: Copyright (c) Orange SA -// SPDX-License-Identifier: MIT -// -// This software is distributed under the MIT license, -// the text of which is available at https://opensource.org/license/MIT/ -// or see the "LICENSE" file for more details. -// -// Authors: See CONTRIBUTORS.txt -// Software description: A SwiftUI components library with code examples for Orange Unified Design System -// - -import OUDSTokensSemantic - -/// This is a component token for a text input in formulars. -/// **Warning: This is a draft component ** -public protocol FormsTextInputComponentTokens { - - var ftiTitleFontWeight: TypographyFontWeightSemanticToken { get } - var ftiTitleFontSize: TypographyFontSizeSemanticToken { get } - var ftiTitleColor: ColorSemanticToken { get } - - var ftiSubtitleFontWeight: TypographyFontWeightSemanticToken { get } - var ftiSubtitleFontSize: TypographyFontSizeSemanticToken { get } - var ftiSubtitleColor: ColorSemanticToken { get } - - var ftiBackgroundColor: ColorSemanticToken { get } - - var ftiBorderColor: ColorSemanticToken { get } - - var ftiBorderStyle: BorderStyleSemanticToken { get } - - var ftiBorderWidth: BorderWidthSemanticToken { get } -} diff --git a/OUDS/Core/Tokens/RawTokens/Sources/Composites/ElevationCompositeRawToken.swift b/OUDS/Core/Tokens/RawTokens/Sources/Composites/ElevationCompositeRawToken.swift index da82de117..a7016fe5b 100644 --- a/OUDS/Core/Tokens/RawTokens/Sources/Composites/ElevationCompositeRawToken.swift +++ b/OUDS/Core/Tokens/RawTokens/Sources/Composites/ElevationCompositeRawToken.swift @@ -44,11 +44,15 @@ public final class ElevationCompositeRawToken: NSObject { // For @objc compatibi radius = blur / 2 } + deinit { } + /// Compares the `self.x`, `self.y`, `self.blur` and `self.color` values between tokens. /// If `object` is not an `ElevationCompositeRawToken`, or ahs one of its four proeprties with another value than `self`, /// return `false`. Otherwise returns `true`. `isEqual` override is preferred for `NSObject`. - public override func isEqual(_ object: Any?) -> Bool { - guard let other = object as? ElevationCompositeRawToken else { return false } + override public func isEqual(_ object: Any?) -> Bool { + guard let other = object as? ElevationCompositeRawToken else { + return false + } return self.x == other.x && self.y == other.y && self.radius == other.radius diff --git a/OUDS/Core/Tokens/RawTokens/Sources/Values/BorderRawTokens+Values.swift b/OUDS/Core/Tokens/RawTokens/Sources/Values/BorderRawTokens+Values.swift index f6ca8f694..5c1253c46 100644 --- a/OUDS/Core/Tokens/RawTokens/Sources/Values/BorderRawTokens+Values.swift +++ b/OUDS/Core/Tokens/RawTokens/Sources/Values/BorderRawTokens+Values.swift @@ -14,6 +14,8 @@ // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + /// Extracted in this separated file to help the *Figma* JSON to Swift parser to generate files to include easily. extension BorderRawTokens { @@ -52,3 +54,5 @@ extension BorderRawTokens { public static let borderStyleDashed: BorderStyleRawToken = "dashed" public static let borderStyleDotted: BorderStyleRawToken = "dotted" } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/RawTokens/Sources/Values/ColorRawTokens+Values.swift b/OUDS/Core/Tokens/RawTokens/Sources/Values/ColorRawTokens+Values.swift index eba7db316..b0edabd4c 100644 --- a/OUDS/Core/Tokens/RawTokens/Sources/Values/ColorRawTokens+Values.swift +++ b/OUDS/Core/Tokens/RawTokens/Sources/Values/ColorRawTokens+Values.swift @@ -14,6 +14,8 @@ // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + /// Extracted in a separated file to help the *Figma* JSON to Swift parser to generate files to include easily. extension ColorRawTokens { @@ -198,3 +200,5 @@ extension ColorRawTokens { public static let colorTransparentWhite800: ColorRawToken = apply(opacity: OpacityRawTokens.opacity800, on: colorFunctionalWhite) public static let colorTransparentWhite900: ColorRawToken = apply(opacity: OpacityRawTokens.opacity900, on: colorFunctionalWhite) } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/RawTokens/Sources/Values/DimensionRawTokens+Values.swift b/OUDS/Core/Tokens/RawTokens/Sources/Values/DimensionRawTokens+Values.swift index 2c76bedc6..34afdfbf1 100644 --- a/OUDS/Core/Tokens/RawTokens/Sources/Values/DimensionRawTokens+Values.swift +++ b/OUDS/Core/Tokens/RawTokens/Sources/Values/DimensionRawTokens+Values.swift @@ -14,6 +14,8 @@ // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + /// Extracted in a separated file to help the *Figma* JSON to Swift parser to generate files to include easily. extension DimensionRawTokens { @@ -58,3 +60,5 @@ extension DimensionRawTokens { public static let dimension9000: DimensionRawToken = dimensionBase * 220 public static let dimension11000: DimensionRawToken = dimensionBase * 260 } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/RawTokens/Sources/Values/ElevationRawTokens+Composites.swift b/OUDS/Core/Tokens/RawTokens/Sources/Values/ElevationRawTokens+Composites.swift index 994752403..c0f40368b 100644 --- a/OUDS/Core/Tokens/RawTokens/Sources/Values/ElevationRawTokens+Composites.swift +++ b/OUDS/Core/Tokens/RawTokens/Sources/Values/ElevationRawTokens+Composites.swift @@ -14,6 +14,8 @@ // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + /// Extracted in a separated file because the the *Figma* JSON to Swift parser is not abale to process such composite tokens, and the *Figma* tool is not able to. /// /// **Beware, may result in desynchronization between generated raw tokens values and theses composite raw tokens** @@ -97,3 +99,5 @@ extension ElevationRawTokens { public static let elevationBottom_6_600 = ElevationCompositeRawToken(x: elevationX0, y: elevationY600, blur: elevationBlur700, color: ColorRawTokens.colorTransparentBlack600) } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/RawTokens/Sources/Values/ElevationRawTokens+Values.swift b/OUDS/Core/Tokens/RawTokens/Sources/Values/ElevationRawTokens+Values.swift index 34f27531a..78d260723 100644 --- a/OUDS/Core/Tokens/RawTokens/Sources/Values/ElevationRawTokens+Values.swift +++ b/OUDS/Core/Tokens/RawTokens/Sources/Values/ElevationRawTokens+Values.swift @@ -14,6 +14,8 @@ // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + /// Extracted in a separated file to help the *Figma* JSON to Swift parser to generate files to include easily. extension ElevationRawTokens { @@ -42,3 +44,5 @@ extension ElevationRawTokens { public static let elevationBlur600: ElevationRawToken = 12 public static let elevationBlur700: ElevationRawToken = 20 } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/RawTokens/Sources/Values/GridRawTokens+Values.swift b/OUDS/Core/Tokens/RawTokens/Sources/Values/GridRawTokens+Values.swift index 6114ac197..b919ae8cc 100644 --- a/OUDS/Core/Tokens/RawTokens/Sources/Values/GridRawTokens+Values.swift +++ b/OUDS/Core/Tokens/RawTokens/Sources/Values/GridRawTokens+Values.swift @@ -14,6 +14,8 @@ // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + /// Extracted in a separated file to help the *Figma* JSON to Swift parser to generate files to include easily. extension GridRawTokens { @@ -30,7 +32,7 @@ extension GridRawTokens { public static let gridMaxWidthExtraCompact: GridRawToken = 389 public static let gridMaxWidthCompact: GridRawToken = 852 - public static let gridMaxWidthRegular: GridRawToken = 1336 + public static let gridMaxWidthRegular: GridRawToken = 1_336 // MARK: Primitive token - Grid - Margin @@ -87,3 +89,5 @@ extension GridRawTokens { public static let gridRegularMargin: GridRawToken = gridMargin500 public static let gridRegularColumnGap: GridRawToken = gridColumnGap300 } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/RawTokens/Sources/Values/OpacityRawTokens+Values.swift b/OUDS/Core/Tokens/RawTokens/Sources/Values/OpacityRawTokens+Values.swift index 714106531..2a8f15ee1 100644 --- a/OUDS/Core/Tokens/RawTokens/Sources/Values/OpacityRawTokens+Values.swift +++ b/OUDS/Core/Tokens/RawTokens/Sources/Values/OpacityRawTokens+Values.swift @@ -14,6 +14,8 @@ // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + /// Extracted in a separated file to help the *Figma* JSON to Swift parser to generate files to include easily. extension OpacityRawTokens { @@ -30,3 +32,5 @@ extension OpacityRawTokens { public static let opacity800: OpacityRawToken = 0.80 public static let opacity900: OpacityRawToken = 1 } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/RawTokens/Sources/Values/TypographyRawTokens+Composites.swift b/OUDS/Core/Tokens/RawTokens/Sources/Values/TypographyRawTokens+Composites.swift index 4dec4b57f..e8bdb62af 100644 --- a/OUDS/Core/Tokens/RawTokens/Sources/Values/TypographyRawTokens+Composites.swift +++ b/OUDS/Core/Tokens/RawTokens/Sources/Values/TypographyRawTokens+Composites.swift @@ -14,6 +14,8 @@ // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + /// Extracted in a separated file because the the *Figma* JSON to Swift parser is not abale to process such composite tokens, and the *Figma* tool is not able to. /// /// **Beware, may result in desynchronization between generated raw tokens values and theses composite raw tokens** @@ -63,3 +65,5 @@ extension TypographyRawTokens { public static let typeBold1850 = TypographyCompositeRawToken(size: fontSize1850, lineHeight: fontLineHeight1850, weight: fontWeight700, letterSpacing: fontLetterSpacing1850) } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/RawTokens/Sources/Values/TypographyRawTokens+Values.swift b/OUDS/Core/Tokens/RawTokens/Sources/Values/TypographyRawTokens+Values.swift index 18e2fce96..08e1d7f50 100644 --- a/OUDS/Core/Tokens/RawTokens/Sources/Values/TypographyRawTokens+Values.swift +++ b/OUDS/Core/Tokens/RawTokens/Sources/Values/TypographyRawTokens+Values.swift @@ -14,6 +14,8 @@ // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + /// Extracted in a separated file to help the *Figma* JSON to Swift parser to generate files to include easily. extension TypographyRawTokens { @@ -76,11 +78,11 @@ extension TypographyRawTokens { public static let fontLetterSpacing750: TypographyFontLetterSpacingRawToken = 750 public static let fontLetterSpacing850: TypographyFontLetterSpacingRawToken = 850 public static let fontLetterSpacing950: TypographyFontLetterSpacingRawToken = 950 - public static let fontLetterSpacing1050: TypographyFontLetterSpacingRawToken = 1050 - public static let fontLetterSpacing1150: TypographyFontLetterSpacingRawToken = 1150 - public static let fontLetterSpacing1250: TypographyFontLetterSpacingRawToken = 1250 - public static let fontLetterSpacing1450: TypographyFontLetterSpacingRawToken = 1450 - public static let fontLetterSpacing1850: TypographyFontLetterSpacingRawToken = 1850 + public static let fontLetterSpacing1050: TypographyFontLetterSpacingRawToken = 1_050 + public static let fontLetterSpacing1150: TypographyFontLetterSpacingRawToken = 1_150 + public static let fontLetterSpacing1250: TypographyFontLetterSpacingRawToken = 1_250 + public static let fontLetterSpacing1450: TypographyFontLetterSpacingRawToken = 1_450 + public static let fontLetterSpacing1850: TypographyFontLetterSpacingRawToken = 1_850 // MARK: Primitive token - Typography - Font family @@ -110,3 +112,5 @@ extension TypographyRawTokens { public static let fontWeight900: TypographyFontWeightRawToken = 900 public static let fontWeight950: TypographyFontWeightRawToken = 950 } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/RawTokens/Tests/BorderRawTokensTests.swift b/OUDS/Core/Tokens/RawTokens/Tests/BorderRawTokensTests.swift index 327f0b816..29e8fa484 100644 --- a/OUDS/Core/Tokens/RawTokens/Tests/BorderRawTokensTests.swift +++ b/OUDS/Core/Tokens/RawTokens/Tests/BorderRawTokensTests.swift @@ -11,8 +11,10 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDSTokensRaw +import XCTest + +// swiftlint:disable required_deinit /// The aim of this tests class is to look for regressions in **border raw tokens**. /// Because these values will be at least generated through an external tool, is it not relevant to test each token values. @@ -181,3 +183,5 @@ final class BorderRawTokensTests: XCTestCase { XCTAssertNotEqual(BorderRawTokens.borderStyleDashed, BorderRawTokens.borderStyleDotted) } } + +// swiftlint:enable required_deinit diff --git a/OUDS/Core/Tokens/RawTokens/Tests/ColorRawTokensTests.swift b/OUDS/Core/Tokens/RawTokens/Tests/ColorRawTokensTests.swift index f15a0c57d..87d396ebd 100644 --- a/OUDS/Core/Tokens/RawTokens/Tests/ColorRawTokensTests.swift +++ b/OUDS/Core/Tokens/RawTokens/Tests/ColorRawTokensTests.swift @@ -11,11 +11,12 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDSTokensRaw import TestsUtils +import XCTest // swiftlint:disable type_body_length +// swiftlint:disable required_deinit /// The aim of this tests class is to look for regressions in **color raw tokens**. /// Because these values will be at least generated through an external tool, is it not relevant to test each token values. @@ -541,3 +542,4 @@ final class ColorRawTokensTests: XCTestCase { } // swiftlint:enable type_body_length +// swiftlint:enable required_deinit diff --git a/OUDS/Core/Tokens/RawTokens/Tests/DimensionRawTokensTests.swift b/OUDS/Core/Tokens/RawTokens/Tests/DimensionRawTokensTests.swift index 200c6ba7a..144989386 100644 --- a/OUDS/Core/Tokens/RawTokens/Tests/DimensionRawTokensTests.swift +++ b/OUDS/Core/Tokens/RawTokens/Tests/DimensionRawTokensTests.swift @@ -11,8 +11,10 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDSTokensRaw +import XCTest + +// swiftlint:disable required_deinit /// The aim of this tests class is to look for regressions in **dimension raw tokens**. /// Because these values will be at least generated through an external tool, is it not relevant to test each token values. @@ -289,3 +291,5 @@ final class DimensionRawTokensTests: XCTestCase { XCTAssertMultipleOf(DimensionRawTokens.dimension11000, factor: DimensionRawTokens.dimensionBase) } } + +// swiftlint:enable required_deinit diff --git a/OUDS/Core/Tokens/RawTokens/Tests/ElevationRawTokensTests.swift b/OUDS/Core/Tokens/RawTokens/Tests/ElevationRawTokensTests.swift index 75d4f5449..b5cf72ed7 100644 --- a/OUDS/Core/Tokens/RawTokens/Tests/ElevationRawTokensTests.swift +++ b/OUDS/Core/Tokens/RawTokens/Tests/ElevationRawTokensTests.swift @@ -11,10 +11,12 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDSFoundations import OUDSTokensRaw import SwiftUI +import XCTest + +// swiftlint:disable required_deinit /// The aim of this tests class is to look for regressions in **elevation raw tokens**. /// Because these values will be at least generated through an external tool, is it not mandatory and relevant to test each token values. @@ -347,3 +349,5 @@ final class ElevationRawTokensTests: XCTestCase { XCTAssertLessThanOrEqual(left.radius, right.radius) } } + +// swiftlint:enable required_deinit diff --git a/OUDS/Core/Tokens/RawTokens/Tests/GridRawTokensTests.swift b/OUDS/Core/Tokens/RawTokens/Tests/GridRawTokensTests.swift index 123865991..26899769c 100644 --- a/OUDS/Core/Tokens/RawTokens/Tests/GridRawTokensTests.swift +++ b/OUDS/Core/Tokens/RawTokens/Tests/GridRawTokensTests.swift @@ -11,8 +11,10 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDSTokensRaw +import XCTest + +// swiftlint:disable required_deinit /// The aim of this tests class is to look for regressions in **grid raw tokens**. /// Because these values will be at least generated through an external tool, is it not mandatory and relevant to test each token values. @@ -199,3 +201,5 @@ final class GridRawTokensTests: XCTestCase { XCTAssertLessThan(GridRawTokens.gridColumnCount1000, GridRawTokens.gridColumnCount1200) } } + +// swiftlint:enable required_deinit diff --git a/OUDS/Core/Tokens/RawTokens/Tests/OpacityRawTokensTests.swift b/OUDS/Core/Tokens/RawTokens/Tests/OpacityRawTokensTests.swift index d0157cb98..6f3125486 100644 --- a/OUDS/Core/Tokens/RawTokens/Tests/OpacityRawTokensTests.swift +++ b/OUDS/Core/Tokens/RawTokens/Tests/OpacityRawTokensTests.swift @@ -11,8 +11,10 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDSTokensRaw +import XCTest + +// swiftlint:disable required_deinit /// The aim of this tests class is to look for regressions in **opacity raw tokens**. /// Because these values will be at least generated through an external tool, is it not relevant to test each token values. @@ -97,3 +99,5 @@ final class OpacityRawTokensTests: XCTestCase { XCTAssertBetween(min: 0, OpacityRawTokens.opacity900, max: 1) } } + +// swiftlint:enable required_deinit diff --git a/OUDS/Core/Tokens/RawTokens/Tests/TypographyRawTokensTests.swift b/OUDS/Core/Tokens/RawTokens/Tests/TypographyRawTokensTests.swift index 786ad99fa..9fff6fc2b 100644 --- a/OUDS/Core/Tokens/RawTokens/Tests/TypographyRawTokensTests.swift +++ b/OUDS/Core/Tokens/RawTokens/Tests/TypographyRawTokensTests.swift @@ -11,10 +11,11 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest @testable import OUDSTokensRaw +import XCTest // swiftlint:disable type_body_length +// swiftlint:disable required_deinit /// The aim of this tests class is to look for regressions in **typography raw tokens**. /// Because these values will be at least generated through an external tool, is it not relevant to test each token values. @@ -387,3 +388,4 @@ final class TypographyRawTokensTests: XCTestCase { } } // swiftlint:enable type_body_length +// swiftlint:enable required_deinit diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleColorTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleColorTokens.swift index 285940c2b..7c75d8327 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleColorTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleColorTokens.swift @@ -11,8 +11,8 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import OUDSTokensRaw import OUDSFoundations +import OUDSTokensRaw import SwiftUI /// Kind of semantic tokens which will wrap a combination of `ColorRawToken` depending to color scheme. @@ -65,10 +65,12 @@ public final class MultipleColorTokens: NSObject { self.init(light: light, dark: dark) } + deinit { } + /// Returns `true` if `self` and `object` has the same `light` and `dark` values and with `object` /// as a `MultipleColorRawToken`. Otherwise returns `false`. /// `isEqual` override is preferred for `NSObject`. - public override func isEqual(_ object: Any?) -> Bool { + override public func isEqual(_ object: Any?) -> Bool { guard let other = object as? MultipleColorTokens else { return false } return self.light == other.light && self.dark == other.dark } diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleElevationTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleElevationTokens.swift index ca7968e35..fb2b15bad 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleElevationTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleElevationTokens.swift @@ -42,10 +42,12 @@ public final class MultipleElevationTokens: NSObject { self.dark = dark } + deinit { } + /// Returns `true` if `self` and `object` has the same `light` and `dark` values and with `object` /// as a `MultipleElevationTokens`. Otherwise returns `false`. /// `isEqual` override is preferred for `NSObject`. - public override func isEqual(_ object: Any?) -> Bool { + override public func isEqual(_ object: Any?) -> Bool { guard let other = object as? MultipleElevationTokens else { return false } return self.light == other.light && self.dark == other.dark } diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleFontLetterSpacingTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleFontLetterSpacingTokens.swift index 3a9b751c7..afb99e1da 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleFontLetterSpacingTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleFontLetterSpacingTokens.swift @@ -40,11 +40,15 @@ public final class MultipleFontLetterSpacingTokens: NSObject { self.regular = regular } + deinit { } + /// Returns `true` if `self` and `object` has the same `compact` and `regular` values and with `object` /// as a `MultipleFontTokens`. Otherwise returns `false`. /// `isEqual` override is preferred for `NSObject`. - public override func isEqual(_ object: Any?) -> Bool { - guard let object = object as? MultipleFontLetterSpacingTokens else { return false } + override public func isEqual(_ object: Any?) -> Bool { + guard let object = object as? MultipleFontLetterSpacingTokens else { + return false + } return self.compact == object.compact && self.regular == object.regular } } diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleFontLineHeightTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleFontLineHeightTokens.swift index 73667991a..20034aa22 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleFontLineHeightTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleFontLineHeightTokens.swift @@ -40,10 +40,12 @@ public final class MultipleFontLineHeightTokens: NSObject { self.regular = regular } + deinit { } + /// Returns `true` if `self` and `object` has the same `compact` and `regular` values and with `object` /// as a `MultipleFontTokens`. Otherwise returns `false`. /// `isEqual` override is preferred for `NSObject`. - public override func isEqual(_ object: Any?) -> Bool { + override public func isEqual(_ object: Any?) -> Bool { guard let object = object as? MultipleFontLineHeightTokens else { return false } return self.compact == object.compact && self.regular == object.regular } diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleFontSizeTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleFontSizeTokens.swift index 2caf6fd93..fd3b3506e 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleFontSizeTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleFontSizeTokens.swift @@ -40,11 +40,15 @@ public final class MultipleFontSizeTokens: NSObject { self.regular = regular } + deinit { } + /// Returns `true` if `self` and `object` has the same `compact` and `regular` values and with `object` /// as a `MultipleFontTokens`. Otherwise returns `false`. /// `isEqual` override is preferred for `NSObject`. - public override func isEqual(_ object: Any?) -> Bool { - guard let object = object as? MultipleFontSizeTokens else { return false } + override public func isEqual(_ object: Any?) -> Bool { + guard let object = object as? MultipleFontSizeTokens else { + return false + } return self.compact == object.compact && self.regular == object.regular } } diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleSizingTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleSizingTokens.swift index de8f1015d..4c743c302 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleSizingTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleSizingTokens.swift @@ -33,11 +33,15 @@ public final class MultipleSizingTokens: NSObject { self.regular = regular } + deinit { } + /// Returns `true` if `self` and `object` has the same `compact` and `regular` values and with `object` /// as a `MultipleSizingTokens`. Otherwise returns `false`. /// `isEqual` override is preferred for `NSObject`. - public override func isEqual(_ object: Any?) -> Bool { - guard let other = object as? MultipleSizingTokens else { return false } + override public func isEqual(_ object: Any?) -> Bool { + guard let other = object as? MultipleSizingTokens else { + return false + } return self.compact == other.compact && self.regular == other.regular } } diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleSpacingTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleSpacingTokens.swift index 983f2fb22..7e6a62084 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleSpacingTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleSpacingTokens.swift @@ -35,10 +35,12 @@ public final class MultipleSpacingTokens: NSObject { self.regular = regular } + deinit { } + /// Returns `true` if `self` and `object` has the same `compact` and `regular` values and with `object` /// as a `MultipleSpacingTokens`. Otherwise returns `false`. /// `isEqual` override is preferred for `NSObject`. - public override func isEqual(_ object: Any?) -> Bool { + override public func isEqual(_ object: Any?) -> Bool { guard let other = object as? MultipleSpacingTokens else { return false } return self.compact == other.compact && self.regular == other.regular } diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleTypographyTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleTypographyTokens.swift index 60eca7f02..47d3b20ae 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleTypographyTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Multiples/MultipleTypographyTokens.swift @@ -41,10 +41,12 @@ public final class MultipleTypographyTokens: NSObject { self.regular = regular } + deinit { } + /// Returns `true` if `self` and `object` has the same `compact` and `regular` values and with `object` /// as a `MultipleTypographyTokens`. Otherwise returns `false`. /// `isEqual` override is preferred for `NSObject`. - public override func isEqual(_ object: Any?) -> Bool { + override public func isEqual(_ object: Any?) -> Bool { guard let object = object as? MultipleTypographyTokens else { return false } return self.compact == object.compact && self.regular == object.regular } diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/BorderSemanticTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/BorderSemanticTokens.swift index d5568fd4b..6bb941eb8 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/BorderSemanticTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/BorderSemanticTokens.swift @@ -14,6 +14,8 @@ // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + /// This is a group of semantic tokens for **borders**. /// It defines all `BorderWidthSemanticToken`, `BorderRadiusSemanticToken` and `BorderStyleSemanticToken` a theme must have. /// @@ -43,3 +45,5 @@ public protocol BorderSemanticTokens { var borderStyleDefault: BorderStyleSemanticToken { get } var borderStyleDrag: BorderStyleSemanticToken { get } } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/ColorSemanticTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/ColorSemanticTokens.swift index 7c17f09d4..88532eafa 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/ColorSemanticTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/ColorSemanticTokens.swift @@ -15,6 +15,8 @@ // [File to generate with the tokenator] // WARNING: Not synchronized anymore with the Figjam +// swiftlint:disable missing_docs + /// This is a group of semantic tokens for **colors**. /// It defines all `ColorSemanticToken` and `ColorAliasSemanticToken` a theme must have. /// Because `ColorSemanticToken` can be based on `ColorAliasSemanticToken` which are optional, the instanciation of such values can result to `nil`, @@ -349,3 +351,5 @@ public protocol ColorSemanticTokens { // TODO: #124 - Add missing colorDecorativeSkin* // TODO: #124 - Add missing colorChart* } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/DimensionSemanticTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/DimensionSemanticTokens.swift index 8c95b0cdd..19b40db79 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/DimensionSemanticTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/DimensionSemanticTokens.swift @@ -14,6 +14,8 @@ // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + /// This is a group of semantic tokens for **dimensions**. /// It defines all `DimensionSemanticToken` a theme must have. /// @@ -46,3 +48,5 @@ public protocol DimensionSemanticTokens { var dimension10XL: DimensionSemanticToken { get } var dimension11XL: DimensionSemanticToken { get } } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/ElevationSemanticTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/ElevationSemanticTokens.swift index 45f5a551d..14a89a0e8 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/ElevationSemanticTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/ElevationSemanticTokens.swift @@ -14,6 +14,8 @@ // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + /// This is a group of semantic tokens for **elevations**. /// It defines all elevation semantic tokens a theme must have. (`ElevationXSemanticToken`,`ElevationYSemanticToken`, /// `ElevationBlurSemanticToken` and `ElevationColorSemanticToken`) @@ -113,3 +115,5 @@ public protocol ElevationSemanticTokens { var elevationFocus: ElevationCompositeSemanticToken { get } } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/GridSemanticTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/GridSemanticTokens.swift index fe1212fa4..4cef8af1d 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/GridSemanticTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/GridSemanticTokens.swift @@ -14,6 +14,8 @@ // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + /// This is a group of semantic tokens for **grids**. /// It defines all `GridSemanticToken` a theme must have. /// @@ -44,3 +46,5 @@ public protocol GridSemanticTokens { var gridRegularColumnGap: GridRegularSemanticToken { get } var gridRegularColumnCount: GridRegularSemanticToken { get } } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/OpacitySemanticTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/OpacitySemanticTokens.swift index eca860503..a4482878f 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/OpacitySemanticTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/OpacitySemanticTokens.swift @@ -14,9 +14,10 @@ // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + /// This is a group of semantic tokens for **opacity.** /// It defines all `OpacitySemanticToken` a theme must have. -/// /// In the future this file should be generated by a parser converting Figma JSON to Swift code. public protocol OpacitySemanticTokens { @@ -29,3 +30,5 @@ public protocol OpacitySemanticTokens { var opacityStrong: OpacitySemanticToken { get } var opacityOpaque: OpacitySemanticToken { get } } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/SizingSemanticTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/SizingSemanticTokens.swift index 95b8d88fd..4b847a615 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/SizingSemanticTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/SizingSemanticTokens.swift @@ -14,6 +14,8 @@ // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + /// This is a group of semantic tokens for **sizing**. /// It defines all `SizingSemanticToken` a theme must have. /// @@ -93,3 +95,5 @@ public protocol SizingSemanticTokens { var sizeMaxWidthTypeBodyMedium: MultipleSizingTokens { get } var sizeMaxWidthTypeBodyLarge: MultipleSizingTokens { get } } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/SpacingSemanticTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/SpacingSemanticTokens.swift index a7c09c51c..5192d8c5e 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/SpacingSemanticTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/SpacingSemanticTokens.swift @@ -14,6 +14,8 @@ // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + /// This is a group of semantic tokens for **spacing**. /// It defines all `SpacingSemanticToken` a theme must have. /// @@ -142,3 +144,5 @@ public protocol SpacingSemanticTokens { var spaceRowGapWithIconMedium: SpacingGapStackSemanticToken { get } var spaceRowGapWithIconTall: SpacingGapStackSemanticToken { get } } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/TypographySemanticTokens.swift b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/TypographySemanticTokens.swift index 730be1a78..48c942d26 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Sources/Values/TypographySemanticTokens.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Sources/Values/TypographySemanticTokens.swift @@ -16,6 +16,8 @@ import OUDSTokensRaw // ଘ( ・ω・)_/゚・:*:・。☆ // [File to generate with the tokenator] +// swiftlint:disable missing_docs + /// This is a group of semantic tokens for **typography**. /// It defines all typography semantic tokens a theme must have /// (`TypographyFontFamilySemanticToken`, `TypographyFontWeightSemanticToken`, `TypographyFontSizeSemanticToken`, `TypographyFontLineHeightSemanticToken`). @@ -143,3 +145,5 @@ public protocol TypographySemanticTokens { var typeCodeMedium: MultipleTypographyTokens { get } var typeCodeSmall: MultipleTypographyTokens { get } } + +// swiftlint:enable missing_docs diff --git a/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleColorSemanticTokenTests.swift b/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleColorSemanticTokenTests.swift index 66d4aa80b..7c20a62c9 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleColorSemanticTokenTests.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleColorSemanticTokenTests.swift @@ -11,9 +11,11 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDSTokensRaw import OUDSTokensSemantic +import XCTest + +// swiftlint:disable required_deinit /// To ensure the `MultipleColorRawToken` is tested as a wrapper of semantic tokens for light and dark color schemes. final class MultipleColorRawTokenTests: XCTestCase { @@ -70,3 +72,5 @@ final class MultipleColorRawTokenTests: XCTestCase { XCTAssertFalse(first.isEqual(sixth)) } } + +// swiftlint:enable required_deinit diff --git a/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleElevationTokensTests.swift b/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleElevationTokensTests.swift index 33ca46d52..b054d253f 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleElevationTokensTests.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleElevationTokensTests.swift @@ -11,9 +11,11 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDSTokensRaw import OUDSTokensSemantic +import XCTest + +// swiftlint:disable required_deinit /// To ensure the `MultipleElevationTokens` is tested as a wrapper of semantic tokens for light and dark color schemes. final class MultipleElevationTokensTests: XCTestCase { @@ -55,3 +57,5 @@ final class MultipleElevationTokensTests: XCTestCase { XCTAssertFalse(first.isEqual(sixth)) } } + +// swiftlint:enable required_deinit diff --git a/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleFontLetterSpacingTokensTests.swift b/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleFontLetterSpacingTokensTests.swift index c53112329..0ce50b0a9 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleFontLetterSpacingTokensTests.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleFontLetterSpacingTokensTests.swift @@ -11,9 +11,11 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDSTokensRaw import OUDSTokensSemantic +import XCTest + +// swiftlint:disable required_deinit /// To ensure the `MultipleFontLetterSpacingTokens` is tested as a wrapper of semantic tokens for compact and regular size classes. final class MultipleFontLetterSpacingTokensTests: XCTestCase { @@ -55,3 +57,4 @@ final class MultipleFontLetterSpacingTokensTests: XCTestCase { XCTAssertFalse(first.isEqual(sixth)) } } +// swiftlint:enable required_deinit diff --git a/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleFontLineHeightTokensTests.swift b/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleFontLineHeightTokensTests.swift index fe9373bd0..8f87b9237 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleFontLineHeightTokensTests.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleFontLineHeightTokensTests.swift @@ -11,9 +11,11 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDSTokensRaw import OUDSTokensSemantic +import XCTest + +// swiftlint:disable required_deinit /// To ensure the `MultipleFontLineHeightTokens` is tested as a wrapper of semantic tokens for compact and regular size classes. final class MultipleFontLineHeightTokensTests: XCTestCase { @@ -55,3 +57,5 @@ final class MultipleFontLineHeightTokensTests: XCTestCase { XCTAssertFalse(first.isEqual(sixth)) } } + +// swiftlint:enable required_deinit diff --git a/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleFontSizeTokensTests.swift b/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleFontSizeTokensTests.swift index dad1ca75e..3d3e27ca1 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleFontSizeTokensTests.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleFontSizeTokensTests.swift @@ -11,9 +11,11 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDSTokensRaw import OUDSTokensSemantic +import XCTest + +// swiftlint:disable required_deinit /// To ensure the `MultipleFontSizeTokens` is tested as a wrapper of semantic tokens for compact and regular size classes. final class MultipleFontSizeTokensTests: XCTestCase { @@ -55,3 +57,5 @@ final class MultipleFontSizeTokensTests: XCTestCase { XCTAssertFalse(first.isEqual(sixth)) } } + +// swiftlint:enable required_deinit diff --git a/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleSizingSemanticTokenTests.swift b/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleSizingSemanticTokenTests.swift index e2fb1352a..803f88d92 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleSizingSemanticTokenTests.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleSizingSemanticTokenTests.swift @@ -11,8 +11,10 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDSTokensSemantic +import XCTest + +// swiftlint:disable required_deinit /// To ensure the `MultipleSizingTokens` is tested as a wrapper of semantic tokens for compact and regular size classes. final class MultipleSizingTokensTests: XCTestCase { @@ -45,3 +47,5 @@ final class MultipleSizingTokensTests: XCTestCase { XCTAssertFalse(first.isEqual(sixth)) } } + +// swiftlint:enable required_deinit diff --git a/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleSpacingTokensTests.swift b/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleSpacingTokensTests.swift index f803d96a4..43376323a 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleSpacingTokensTests.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleSpacingTokensTests.swift @@ -11,9 +11,11 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDSTokensRaw import OUDSTokensSemantic +import XCTest + +// swiftlint:disable required_deinit /// To ensure the `MultipleSpacingTokens` is tested as a wrapper of semantic tokens for compact and regular size classes. final class MultipleSpacingTokensTests: XCTestCase { @@ -46,3 +48,4 @@ final class MultipleSpacingTokensTests: XCTestCase { XCTAssertFalse(first.isEqual(sixth)) } } +// swiftlint:enable required_deinit diff --git a/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleTypographyTokensTests.swift b/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleTypographyTokensTests.swift index 5695e8262..241c948a0 100644 --- a/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleTypographyTokensTests.swift +++ b/OUDS/Core/Tokens/SemanticTokens/Tests/Multiples/MultipleTypographyTokensTests.swift @@ -11,9 +11,11 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest import OUDSTokensRaw import OUDSTokensSemantic +import XCTest + +// swiftlint:disable required_deinit /// To ensure the `MultipleTypographyTokens` is tested as a wrapper of semantic tokens for compact and regular size classes. final class MultipleTypographyTokensTests: XCTestCase { @@ -55,3 +57,4 @@ final class MultipleTypographyTokensTests: XCTestCase { XCTAssertFalse(first.isEqual(sixth)) } } +// swiftlint:enable required_deinit diff --git a/OUDS/Foundations/Sources/Extensions/String+SwiftUI.swift b/OUDS/Foundations/Sources/Extensions/String+SwiftUI.swift index 276ef3593..9245c2aa4 100644 --- a/OUDS/Foundations/Sources/Extensions/String+SwiftUI.swift +++ b/OUDS/Foundations/Sources/Extensions/String+SwiftUI.swift @@ -14,9 +14,12 @@ import Foundation import SwiftUI +// swiftlint:disable implicitly_unwrapped_optional + extension String { /// `String` extension to get a `Color` from `self` supposed to be an hexadecimal string representation. + /// We assume the value of `self` is a valid hexadecimal string. public var color: Color! { Color(hexadecimalCode: self) } @@ -40,3 +43,5 @@ extension String { // TODO: String manipulation can be costly, add values in Cache } } + +// swiftlint:enable implicitly_unwrapped_optional diff --git a/OUDS/Foundations/Sources/OUDSLogger.swift b/OUDS/Foundations/Sources/OUDSLogger.swift index 74bdbe112..35ff71443 100644 --- a/OUDS/Foundations/Sources/OUDSLogger.swift +++ b/OUDS/Foundations/Sources/OUDSLogger.swift @@ -23,26 +23,37 @@ public struct OUDSLogger { private static let bullet: String = "🍊" private static let prefix: String = "\(bullet) [OUDS]" + /// If compile mode is set as DEBUG, logs the message with a "debug" prefix + /// and the `debug` method of the `os.Logger` + /// - Parameter message: The message to log after the decoration public static func debug(_ message: String) { #if DEBUG logger.debug("\(prefix):debug: 🪲 \(message)") #endif } + /// Logs the message with a "log" prefix and the `log` method of the `os.Logger` + /// - Parameter message: The message to log after the prefix public static func log(_ message: String) { #if DEBUG logger.log("\(prefix): 🗒️ \(message)") #endif } + /// Logs the message with a "info" prefix and the `info` method of the `os.Logger` + /// - Parameter message: The message to log after the prefix public static func info(_ message: String) { logger.info("\(prefix):info: ℹ️ \(message)") } + /// Logs the message with a "warning" prefix and the `warning` method of the `os.Logger` + /// - Parameter message: The message to log after the prefix public static func warning(_ message: String) { logger.warning("\(prefix):warning: ⚠️ \(message)") } + /// Logs the message with a "error" prefix and the `error` method of the `os.Logger` + /// - Parameter message: The message to log after the prefix public static func error(_ message: String) { logger.error("\(prefix):error: 💥 \(message)") } diff --git a/OUDS/Foundations/Tests/Extensions/TestColor+extensions.swift b/OUDS/Foundations/Tests/Extensions/TestColor+extensions.swift index 0a357e77d..77f3ede0c 100644 --- a/OUDS/Foundations/Tests/Extensions/TestColor+extensions.swift +++ b/OUDS/Foundations/Tests/Extensions/TestColor+extensions.swift @@ -11,9 +11,12 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import XCTest -import SwiftUI import OUDSFoundations +import SwiftUI +import XCTest + +// swiftlint:disable required_deinit +// swiftlint:disable force_unwrapping /// To test some extensions of `SwiftUI.Color` final class TestColor_extensions: XCTestCase { @@ -63,3 +66,6 @@ extension Color { } } // swiftlint:enable large_tuple + +// swiftlint:enable required_deinit +// swiftlint:enable force_unwrapping diff --git a/OUDS/Foundations/Tests/Extensions/TestFont+extensions.swift b/OUDS/Foundations/Tests/Extensions/TestFont+extensions.swift index 3ffa25a78..48f54abf9 100644 --- a/OUDS/Foundations/Tests/Extensions/TestFont+extensions.swift +++ b/OUDS/Foundations/Tests/Extensions/TestFont+extensions.swift @@ -16,6 +16,8 @@ import OUDSFoundations import SwiftUI import XCTest +// swiftlint:disable required_deinit + /// Class to test `Font` extensions related to `SwiftUI` final class TestFont_SwiftUI: XCTestCase { @@ -42,3 +44,5 @@ final class TestFont_SwiftUI: XCTestCase { XCTAssertTrue("\(Font.Weight.black)" == "Black") } } + +// swiftlint:enable required_deinit diff --git a/OUDS/Foundations/Tests/Extensions/TestInt+SwiftUI.swift b/OUDS/Foundations/Tests/Extensions/TestInt+SwiftUI.swift index a55f08ec4..2fa1bba09 100644 --- a/OUDS/Foundations/Tests/Extensions/TestInt+SwiftUI.swift +++ b/OUDS/Foundations/Tests/Extensions/TestInt+SwiftUI.swift @@ -16,6 +16,8 @@ import OUDSFoundations import SwiftUI import XCTest +// swiftlint:disable required_deinit + /// Class to test `Int` extensions related to `SwiftUI` final class TestInt_SwiftUI: XCTestCase { @@ -56,7 +58,9 @@ final class TestInt_SwiftUI: XCTestCase { XCTAssertTrue(951.fontWeight == Font.Weight.regular) // Other default cases - XCTAssertTrue(1000.fontWeight == Font.Weight.regular) + XCTAssertTrue(1_000.fontWeight == Font.Weight.regular) XCTAssertTrue((-1).fontWeight == Font.Weight.regular) } } + +// swiftlint:enable required_deinit diff --git a/OUDS/Foundations/Tests/Extensions/TestString+SwiftUI.swift b/OUDS/Foundations/Tests/Extensions/TestString+SwiftUI.swift index 6caedcd4b..e167a23a5 100644 --- a/OUDS/Foundations/Tests/Extensions/TestString+SwiftUI.swift +++ b/OUDS/Foundations/Tests/Extensions/TestString+SwiftUI.swift @@ -16,6 +16,8 @@ import OUDSFoundations import SwiftUI import XCTest +// swiftlint:disable required_deinit + /// Class to test `String` extensions related to `SwiftUI` final class TestString_SwiftUI: XCTestCase { @@ -82,6 +84,8 @@ final class TestString_SwiftUI: XCTestCase { XCTAssertTrue(result == "Menlo", "Current value is '\(result)") result = "".compose(withFont: "Yippee ki-yay") - XCTAssertTrue(result == "", "Current value is '\(result)") + XCTAssertTrue(result.isEmpty, "Current value is '\(result)") } } + +// swiftlint:enable required_deinit diff --git a/OUDS/Foundations/TestsUtils/XCTestCase+extensions.swift b/OUDS/Foundations/TestsUtils/XCTestCase+extensions.swift index e9310d46c..b6b084c81 100644 --- a/OUDS/Foundations/TestsUtils/XCTestCase+extensions.swift +++ b/OUDS/Foundations/TestsUtils/XCTestCase+extensions.swift @@ -14,6 +14,8 @@ import Foundation import XCTest +// swiftlint:disable force_unwrapping + extension XCTestCase { /// Checks if `value` is between `min` and `max` @@ -53,3 +55,5 @@ extension XCTestCase { return Int(exactly: intValue)! } } + +// swiftlint:enable force_unwrapping diff --git a/OUDS/README.md b/OUDS/README.md index 783157039..507975256 100644 --- a/OUDS/README.md +++ b/OUDS/README.md @@ -238,22 +238,22 @@ class OrangeCustomTheme: OrangeTheme { } extension OrangeCustomTheme { // For FormsTextInputComponentTokens, used in component FormsTextInputComponent - public override var ftiTitleFontWeight: TypographyFontWeightSemanticToken { fontWeightLabelStrong } - public override var ftiTitleFontSize: TypographyFontSizeSemanticToken { fontSizeLabelXLarge } - public override var ftiTitleColor: ColorSemanticToken { ColorRawTokens.colorFunctionalDodgerBlue500 } + override public var ftiTitleFontWeight: TypographyFontWeightSemanticToken { fontWeightLabelStrong } + override public var ftiTitleFontSize: TypographyFontSizeSemanticToken { fontSizeLabelXLarge } + override public var ftiTitleColor: ColorSemanticToken { ColorRawTokens.colorFunctionalDodgerBlue500 } - public override var ftiSubtitleFontWeight: TypographyFontWeightSemanticToken { fontWeightBodyDefault } - public override var ftiSubtitleFontSize: TypographyFontSizeSemanticToken { fontSizeLabelMedium } - public override var ftiSubtitleColor: ColorSemanticToken { ColorRawTokens.colorFunctionalMalachite500 } + override public var ftiSubtitleFontWeight: TypographyFontWeightSemanticToken { fontWeightBodyDefault } + override public var ftiSubtitleFontSize: TypographyFontSizeSemanticToken { fontSizeLabelMedium } + override public var ftiSubtitleColor: ColorSemanticToken { ColorRawTokens.colorFunctionalMalachite500 } - public override var ftiBackgroundColorLight: ColorSemanticToken { colorBackgroundDefaultPrimaryLight } - public override var ftiBackgroundColorDark: ColorSemanticToken { colorBackgroundDefaultPrimaryDark } + override public var ftiBackgroundColorLight: ColorSemanticToken { colorBackgroundDefaultPrimaryLight } + override public var ftiBackgroundColorDark: ColorSemanticToken { colorBackgroundDefaultPrimaryDark } - public override var ftiBorderColor: ColorSemanticToken { colorBorderEmphasizedDark ?? MyThemeColorRawTokens.someAwesomeThemeExclusiveColor } + override public var ftiBorderColor: ColorSemanticToken { colorBorderEmphasizedDark ?? MyThemeColorRawTokens.someAwesomeThemeExclusiveColor } - public override var ftiBorderStyle: BorderStyleSemanticToken { borderStyleDrag } + override public var ftiBorderStyle: BorderStyleSemanticToken { borderStyleDrag } - public override var ftiBorderWidth: BorderWidthSemanticToken { borderWidthThick } + override public var ftiBorderWidth: BorderWidthSemanticToken { borderWidthThick } } extension OrangeCustomTheme { // For ColorSemanticTokens using anywhere diff --git a/Showcase/Showcase.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Showcase/Showcase.xcworkspace/xcshareddata/swiftpm/Package.resolved index 4ea553df3..a3e005ea8 100644 --- a/Showcase/Showcase.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/Showcase/Showcase.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "81dd24fcf515e36030cf2a7c4f61c707b77ba95118788932a6b66286a8b60877", + "originHash" : "2311da8556cf7c12c17ce279699951a606d0aeffc588ffb357327761ce5ca0b7", "pins" : [ { "identity" : "swift-docc-plugin", diff --git a/Showcase/Showcase/OrangeCustomTheme.swift b/Showcase/Showcase/OrangeCustomTheme.swift index 271ddac6d..28431ab4d 100644 --- a/Showcase/Showcase/OrangeCustomTheme.swift +++ b/Showcase/Showcase/OrangeCustomTheme.swift @@ -11,38 +11,20 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import SwiftUI +import OUDSThemesOrange import OUDSTokensComponent import OUDSTokensRaw import OUDSTokensSemantic -import OUDSThemesOrange +import SwiftUI -// swiftlint:disable line_length +// swiftlint:disable required_deinit +// swiftlint:disable no_grouping_extension +// swiftlint:disable force_unwrapping +// swiftlint:disable implicitly_unwrapped_optional // Can be for example a country theme class OrangeCustomTheme: OrangeTheme { } -/// Overrides for `FormsTextInputComponentTokens` the configuration which for this theme. -/// **Warning: These are random and dumb values** -extension OrangeCustomTheme { // For FormsTextInputComponentTokens - - public override var ftiTitleFontWeight: TypographyFontWeightSemanticToken { fontWeightLabelStrong } - public override var ftiTitleFontSize: TypographyFontSizeSemanticToken { fontSizeLabelXLarge } - public override var ftiTitleColor: ColorSemanticToken { MultipleColorTokens(ColorRawTokens.colorFunctionalDodgerBlue500) } - - public override var ftiSubtitleFontWeight: TypographyFontWeightSemanticToken { fontWeightBodyDefault } - public override var ftiSubtitleFontSize: TypographyFontSizeSemanticToken { fontSizeLabelMedium } - public override var ftiSubtitleColor: ColorSemanticToken { MultipleColorTokens(ColorRawTokens.colorFunctionalMalachite500) } - - public override var ftiBackgroundColor: ColorSemanticToken { colorBackgroundDefaultPrimary } - - public override var ftiBorderColor: ColorSemanticToken { MultipleColorTokens(light: ColorRawTokens.colorDecorativeShockingPink800, dark: ColorRawTokens.colorDecorativeShockingPink200) } - - public override var ftiBorderStyle: BorderStyleSemanticToken { borderStyleDrag } - - public override var ftiBorderWidth: BorderWidthSemanticToken { borderWidthDefault } -} - extension OrangeCustomTheme { // For ColorSemanticTokens override var colorBackgroundDefaultPrimary: ColorSemanticToken! { MultipleColorTokens(light: ColorRawTokens.colorFunctionalSun500, dark: ColorRawTokens.colorFunctionalSun800) } @@ -65,4 +47,8 @@ extension OrangeCustomTheme { // For ButtonsComponentTokens override var buttonTypography: MultipleTypographyTokens { typeDisplaySmall } } -// swiftlint:enable line_length + +// swiftlint:enable required_deinit +// swiftlint:enable no_grouping_extension +// swiftlint:enable force_unwrapping +// swiftlint:enable implicitly_unwrapped_optional diff --git a/Showcase/Showcase/Pages/Components/ComponentsPage.swift b/Showcase/Showcase/Pages/Components/ComponentsPage.swift index d688ca15b..cbeab94aa 100644 --- a/Showcase/Showcase/Pages/Components/ComponentsPage.swift +++ b/Showcase/Showcase/Pages/Components/ComponentsPage.swift @@ -11,10 +11,10 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import SwiftUI import OUDS -import OUDSThemesOrange import OUDSComponents +import OUDSThemesOrange +import SwiftUI // MARK: - View for display diff --git a/Showcase/Showcase/Pages/Components/EmptyState.swift b/Showcase/Showcase/Pages/Components/EmptyState.swift index e68d4b9da..002c05d58 100644 --- a/Showcase/Showcase/Pages/Components/EmptyState.swift +++ b/Showcase/Showcase/Pages/Components/EmptyState.swift @@ -11,8 +11,8 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import SwiftUI import OUDSTokensSemantic +import SwiftUI struct EmptyState: View { @@ -22,6 +22,7 @@ struct EmptyState: View { ScrollView { VStack(alignment: .center, spacing: theme.spaceFixedMedium) { Image("il_empty_screen") + .accessibilityHidden(true) .frame(width: 160, height: 160, alignment: .center) VStack(alignment: .center, spacing: theme.spaceFixedShorter) { diff --git a/Showcase/Showcase/Pages/ThemeSelection/ThemeSelection.swift b/Showcase/Showcase/Pages/ThemeSelection/ThemeSelection.swift index d33b56112..b1c5200fe 100644 --- a/Showcase/Showcase/Pages/ThemeSelection/ThemeSelection.swift +++ b/Showcase/Showcase/Pages/ThemeSelection/ThemeSelection.swift @@ -80,6 +80,8 @@ final class ThemeProvider: ObservableObject { currentTheme = defaultTheme } } + + deinit { } } // MARK: - Theme Selection Button diff --git a/Showcase/Showcase/Pages/Tokens/Border/BorderTokenPage.swift b/Showcase/Showcase/Pages/Tokens/Border/BorderTokenPage.swift index 65770ee77..aa3c2d9c6 100644 --- a/Showcase/Showcase/Pages/Tokens/Border/BorderTokenPage.swift +++ b/Showcase/Showcase/Pages/Tokens/Border/BorderTokenPage.swift @@ -11,12 +11,13 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import SwiftUI import OUDS +import OUDSComponents import OUDSTokensSemantic -import OUDSComponents // for BorderStyleModifier +import SwiftUI -// Remark: do we need to keep BorderStyleModifier in OUDSComponent or move it to OUDS or OUDSSementicToken ? +// TODO: Check if we can get rid of alias colors tokens which are optional +// swiftlint:disable force_unwrapping struct BorderTokenPage: View { @@ -116,6 +117,7 @@ struct BorderTokenPage: View { } } } +// swiftlint:enable force_unwrapping private enum NamedBorderRadius: String, CaseIterable { case borderRadiusNone diff --git a/Showcase/Showcase/Pages/Tokens/Dimension/Sizing/SizingTokenPage.swift b/Showcase/Showcase/Pages/Tokens/Dimension/Sizing/SizingTokenPage.swift index 22adaf4b5..1b1e17e6c 100644 --- a/Showcase/Showcase/Pages/Tokens/Dimension/Sizing/SizingTokenPage.swift +++ b/Showcase/Showcase/Pages/Tokens/Dimension/Sizing/SizingTokenPage.swift @@ -15,6 +15,9 @@ import OUDS import OUDSTokensSemantic import SwiftUI +// TODO: Check if we can get rid of colors alaises tokens to avoid handling optional values +// swiftlint:disable force_unwrapping + struct SizingTokenPage: View { @Environment(\.theme) private var theme @@ -53,11 +56,14 @@ struct SizingTokenPage: View { .foregroundColor(.blue) // .foregroundColor((theme.colorBackgroundStatusAttractiveEmphasized?.color(for: colorScheme))!) // TODO: Update when color is available .frame(width: token, height: token, alignment: .center) + .accessibilityHidden(true) } } } } +// swiftlint:enable force_unwrapping + // MARK: - Named Spacing private enum NamedSizing: String, CaseIterable { diff --git a/Showcase/Showcase/Pages/Tokens/Dimension/Spacing/SpacingTokenPage.swift b/Showcase/Showcase/Pages/Tokens/Dimension/Spacing/SpacingTokenPage.swift index 61e0e49c9..3629c2ace 100644 --- a/Showcase/Showcase/Pages/Tokens/Dimension/Spacing/SpacingTokenPage.swift +++ b/Showcase/Showcase/Pages/Tokens/Dimension/Spacing/SpacingTokenPage.swift @@ -15,6 +15,9 @@ import OUDS import OUDSTokensSemantic import SwiftUI +// TODO: Check if we can get rid of alias colors tokens which are optional +// swiftlint:disable force_unwrapping + struct SpacingTokenPage: View { @Environment(\.theme) private var theme @@ -58,6 +61,8 @@ struct SpacingTokenPage: View { } } +// swiftlint:enable force_unwrapping + // MARK: - Named Spacing private enum NamedSpacing: String, CaseIterable { diff --git a/Showcase/Showcase/Pages/Tokens/Elevation/ElevationTokenPage.swift b/Showcase/Showcase/Pages/Tokens/Elevation/ElevationTokenPage.swift index e6a6683ee..c2f402d44 100644 --- a/Showcase/Showcase/Pages/Tokens/Elevation/ElevationTokenPage.swift +++ b/Showcase/Showcase/Pages/Tokens/Elevation/ElevationTokenPage.swift @@ -11,10 +11,10 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import SwiftUI import OUDS import OUDSTokensRaw import OUDSTokensSemantic +import SwiftUI // MARK: - Elevation Token Page @@ -48,7 +48,6 @@ struct ElevationTokenPage: View { .foregroundColor(theme.colorBackgroundDefaultSecondary?.color(for: colorScheme)) .shadow(elevation: token) .padding(.bottom, 2) - } } } diff --git a/Showcase/Showcase/Pages/Tokens/Opacity/OpacityTokenPage.swift b/Showcase/Showcase/Pages/Tokens/Opacity/OpacityTokenPage.swift index 764f60429..c2d515270 100644 --- a/Showcase/Showcase/Pages/Tokens/Opacity/OpacityTokenPage.swift +++ b/Showcase/Showcase/Pages/Tokens/Opacity/OpacityTokenPage.swift @@ -12,10 +12,13 @@ // import OUDS -import OUDSComponents // for BorderStyleModifier +import OUDSComponents import OUDSTokensSemantic import SwiftUI +// TODO: Check if we can get rid of colors alaises tokens to avoid handling optional values +// swiftlint:disable force_unwrapping + // MARK: - Opacity Token Page struct OpacityTokenPage: View { @@ -47,6 +50,7 @@ struct OpacityTokenPage: View { Image("ic_union") .resizable() .frame(width: 44, height: 44) + .accessibilityHidden(true) Rectangle() .fill((theme.colorContentDefault?.color(for: colorScheme))!) @@ -107,3 +111,5 @@ private enum NamedOpacity: String, CaseIterable { } } } + +// swiftlint:enable force_unwrapping diff --git a/Showcase/Showcase/Pages/Tokens/Typography/TypographyTokenPage.swift b/Showcase/Showcase/Pages/Tokens/Typography/TypographyTokenPage.swift index 03a45c962..fc473a5e1 100644 --- a/Showcase/Showcase/Pages/Tokens/Typography/TypographyTokenPage.swift +++ b/Showcase/Showcase/Pages/Tokens/Typography/TypographyTokenPage.swift @@ -15,7 +15,10 @@ import OUDS import OUDSTokensSemantic import SwiftUI +// swiftlint:disable force_unwrapping + // MARK: - Typography Token Page + struct TypographyTokenPage: View { @Environment(\.theme) private var theme @@ -112,6 +115,8 @@ struct TypographyTokenPage: View { } } +// swiftlint:enable force_unwrapping + // MARK: - Named Typography private enum NamedTypography: String, CaseIterable { diff --git a/Showcase/Showcase/Pages/Utils/ShowcaseElementPage.swift b/Showcase/Showcase/Pages/Utils/ShowcaseElementPage.swift index 2bee5a600..3e697b87c 100644 --- a/Showcase/Showcase/Pages/Utils/ShowcaseElementPage.swift +++ b/Showcase/Showcase/Pages/Utils/ShowcaseElementPage.swift @@ -11,9 +11,9 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import SwiftUI import OUDS import OUDSTokensSemantic +import SwiftUI struct ShowcaseElementPage: View { @@ -37,7 +37,6 @@ struct ShowcaseElementPage: View { .typeBodyDefaultLarge(theme) .accessibilityFocused($requestFocus) .padding(.horizontal, theme.spaceFixedMedium) - } .listRowInsets(EdgeInsets()) .listRowSeparator(Visibility.hidden) diff --git a/Showcase/Showcase/Pages/Utils/ShowcaseTokenIllustration.swift b/Showcase/Showcase/Pages/Utils/ShowcaseTokenIllustration.swift index 56ca18170..07612fd53 100644 --- a/Showcase/Showcase/Pages/Utils/ShowcaseTokenIllustration.swift +++ b/Showcase/Showcase/Pages/Utils/ShowcaseTokenIllustration.swift @@ -11,9 +11,11 @@ // Software description: A SwiftUI components library with code examples for Orange Unified Design System // -import SwiftUI import OUDS import OUDSTokensSemantic +import SwiftUI + +// swiftlint:disable force_unwrapping struct ShowcaseTokenIllustration: View where TokenIllustration: View { @@ -57,3 +59,5 @@ struct ShowcaseTokenIllustration: View where TokenIllustratio .padding(.vertical, theme.spaceFixedShorter) } } + +// swiftlint:enable force_unwrapping diff --git a/Showcase/Showcase/Pages/Utils/ShowcaseVariantElement.swift b/Showcase/Showcase/Pages/Utils/ShowcaseVariantElement.swift index 33fcd0c75..add58cbd3 100644 --- a/Showcase/Showcase/Pages/Utils/ShowcaseVariantElement.swift +++ b/Showcase/Showcase/Pages/Utils/ShowcaseVariantElement.swift @@ -15,6 +15,8 @@ import OUDS import OUDSTokensSemantic import SwiftUI +// swiftlint:disable force_unwrapping + struct ShowcaseVariantElement: View { @Environment(\.theme) private var theme @@ -40,3 +42,5 @@ struct ShowcaseVariantElement: View { .padding(.horizontal, theme.spaceFixedMedium) } } + +// swiftlint:enable force_unwrapping diff --git a/Showcase/Showcase/Utils/WebView.swift b/Showcase/Showcase/Utils/WebView.swift index 7f5b5cc50..abd50e6dd 100644 --- a/Showcase/Showcase/Utils/WebView.swift +++ b/Showcase/Showcase/Utils/WebView.swift @@ -39,7 +39,7 @@ struct WebView: UIViewRepresentable { @MainActor func makeUIView(context: Context) -> WKWebView { - return WKWebView() + WKWebView() } @MainActor