diff --git a/CommandTests/Generated/html_format.2.e5ef416a.md b/CommandTests/Generated/html_format.2.e5ef416a.md index 494c50b..3c2e705 100644 --- a/CommandTests/Generated/html_format.2.e5ef416a.md +++ b/CommandTests/Generated/html_format.2.e5ef416a.md @@ -103,7 +103,7 @@
-

Diff Results

+

Δ xcdiff result

❌ FILE_REFERENCES

❌ BUILD_PHASES > "MismatchingLibrary" target

✅ BUILD_PHASES > "Project" target

✅ BUILD_PHASES > "ProjectFramework" target

✅ BUILD_PHASES > "ProjectTests" target

✅ BUILD_PHASES > "ProjectUITests" target

✅ COPY_FILES > "MismatchingLibrary" target

❌ COPY_FILES > "Project" target > Embed Frameworks

✅ COPY_FILES > "ProjectFramework" target

✅ COPY_FILES > "ProjectTests" target

✅ COPY_FILES > "ProjectUITests" target

❌ TARGETS > NATIVE targets

❌ TARGETS > AGGREGATE targets

❌ HEADERS > "MismatchingLibrary" target

✅ HEADERS > "Project" target

❌ HEADERS > "ProjectFramework" target

✅ HEADERS > "ProjectTests" target

✅ HEADERS > "ProjectUITests" target

✅ SOURCES > "MismatchingLibrary" target

❌ SOURCES > "Project" target

✅ SOURCES > "ProjectFramework" target

❌ SOURCES > "ProjectTests" target

❌ SOURCES > "ProjectUITests" target

✅ RESOURCES > "MismatchingLibrary" target

❌ RESOURCES > "Project" target

✅ RESOURCES > "ProjectFramework" target

❌ RESOURCES > "ProjectTests" target

❌ RESOURCES > "ProjectUITests" target

❌ CONFIGURATIONS > Root project

❌ SETTINGS > Root project > "Debug" configuration > Base configuration

❌ SETTINGS > Root project > "Debug" configuration > Values

✅ SETTINGS > Root project > "Release" configuration > Base configuration

❌ SETTINGS > Root project > "Release" configuration > Values

✅ SETTINGS > "MismatchingLibrary" target > "Debug" configuration > Base configuration

❌ SETTINGS > "MismatchingLibrary" target > "Debug" configuration > Values

✅ SETTINGS > "MismatchingLibrary" target > "Release" configuration > Base configuration

❌ SETTINGS > "MismatchingLibrary" target > "Release" configuration > Values

❌ SETTINGS > "Project" target > "Debug" configuration > Base configuration

❌ SETTINGS > "Project" target > "Debug" configuration > Values

✅ SETTINGS > "Project" target > "Release" configuration > Base configuration

❌ SETTINGS > "Project" target > "Release" configuration > Values

✅ SETTINGS > "ProjectFramework" target > "Debug" configuration > Base configuration

❌ SETTINGS > "ProjectFramework" target > "Debug" configuration > Values

✅ SETTINGS > "ProjectFramework" target > "Release" configuration > Base configuration

❌ SETTINGS > "ProjectFramework" target > "Release" configuration > Values

✅ SETTINGS > "ProjectTests" target > "Debug" configuration > Base configuration

✅ SETTINGS > "ProjectTests" target > "Debug" configuration > Values

✅ SETTINGS > "ProjectTests" target > "Release" configuration > Base configuration

✅ SETTINGS > "ProjectTests" target > "Release" configuration > Values

✅ SETTINGS > "ProjectUITests" target > "Debug" configuration > Base configuration

✅ SETTINGS > "ProjectUITests" target > "Debug" configuration > Values

✅ SETTINGS > "ProjectUITests" target > "Release" configuration > Base configuration

✅ SETTINGS > "ProjectUITests" target > "Release" configuration > Values

❌ SOURCE_TREES > Root project

✅ LINKED_DEPENDENCIES > "MismatchingLibrary" target

❌ LINKED_DEPENDENCIES > "Project" target

✅ LINKED_DEPENDENCIES > "ProjectFramework" target

✅ LINKED_DEPENDENCIES > "ProjectTests" target

✅ LINKED_DEPENDENCIES > "ProjectUITests" target

diff --git a/CommandTests/Generated/html_format_verbose.2.3ef640ed.md b/CommandTests/Generated/html_format_verbose.2.3ef640ed.md index 2efbf06..f658cf0 100644 --- a/CommandTests/Generated/html_format_verbose.2.3ef640ed.md +++ b/CommandTests/Generated/html_format_verbose.2.3ef640ed.md @@ -103,7 +103,7 @@
-

Diff Results

+

Δ xcdiff result

❌ FILE_REFERENCES

⚠️ Only in first (8):

  • Project/Group B/AViewController.xib
  • Project/Group B/AnotherObjcClass.h
  • Project/Group B/AnotherObjcClass.m
  • Project/Resources/time.png
  • ProjectTests/BarTests.swift
  • ProjectUITests/LoginTests.swift
  • ProjectUITests/Screenshots/empty.png
  • libMismatchingLibrary.a

⚠️ Only in second (11):

  • MismatchingLibrary.framework
  • MismatchingLibrary/MismatchingLibrary-Info.plist
  • NewFramework.framework
  • NewFramework/Info.plist
  • NewFramework/NewFramework.h
  • Project/Project.xcconfig
  • Project/Target.xcconfig
  • ProjectFramework/Header4.h
  • ProjectTests/Responses/ListResponse.json
  • ProjectUITests/MetricsTests.swift
  • README.md

❌ BUILD_PHASES > "MismatchingLibrary" target

⚠️ Only in first (1):

  • CopyFiles

⚠️ Only in second (2):

  • Headers
  • Resources

✅ BUILD_PHASES > "Project" target

✅ BUILD_PHASES > "ProjectFramework" target

✅ BUILD_PHASES > "ProjectTests" target

✅ BUILD_PHASES > "ProjectUITests" target

✅ COPY_FILES > "MismatchingLibrary" target

❌ COPY_FILES > "Project" target > Embed Frameworks

⚠️ Only in second (2):

  • MismatchingLibrary.framework
  • NewFramework.framework

⚠️ Value mismatch (1):

  • ProjectFramework.framework

    • attributes = ["CodeSignOnCopy", "RemoveHeadersOnCopy"]
    • attributes = []

✅ COPY_FILES > "ProjectFramework" target

✅ COPY_FILES > "ProjectTests" target

✅ COPY_FILES > "ProjectUITests" target

❌ TARGETS > NATIVE targets

⚠️ Only in second (1):

  • NewFramework

⚠️ Value mismatch (1):

  • MismatchingLibrary product type

    • com.apple.product-type.library.static
    • com.apple.product-type.framework

❌ TARGETS > AGGREGATE targets

⚠️ Only in second (1):

  • NewAggregate

❌ HEADERS > "MismatchingLibrary" target

⚠️ Only in second (1):

  • MismatchingLibrary/MismatchingLibrary.h

✅ HEADERS > "Project" target

❌ HEADERS > "ProjectFramework" target

⚠️ Only in second (1):

  • ProjectFramework/Header4.h

⚠️ Value mismatch (2):

  • ProjectFramework/Header1.h attributes

    • Public
    • nil (Project)
  • ProjectFramework/Header2.h attributes

    • Private
    • nil (Project)

✅ HEADERS > "ProjectTests" target

✅ HEADERS > "ProjectUITests" target

✅ SOURCES > "MismatchingLibrary" target

❌ SOURCES > "Project" target

⚠️ Only in first (1):

  • Project/Group B/AnotherObjcClass.m

⚠️ Value mismatch (1):

  • Project/Group A/ObjcClass.m compiler flags

    • nil
    • -ObjC

✅ SOURCES > "ProjectFramework" target

❌ SOURCES > "ProjectTests" target

⚠️ Only in first (1):

  • ProjectTests/BarTests.swift

❌ SOURCES > "ProjectUITests" target

⚠️ Only in first (1):

  • ProjectUITests/LoginTests.swift

⚠️ Only in second (1):

  • ProjectUITests/MetricsTests.swift

✅ RESOURCES > "MismatchingLibrary" target

❌ RESOURCES > "Project" target

⚠️ Only in first (2):

  • Project/Group B/AViewController.xib
  • Project/Resources/time.png

✅ RESOURCES > "ProjectFramework" target

❌ RESOURCES > "ProjectTests" target

⚠️ Only in second (1):

  • ProjectTests/Responses/ListResponse.json

❌ RESOURCES > "ProjectUITests" target

⚠️ Only in first (1):

  • ProjectUITests/Screenshots/empty.png

❌ CONFIGURATIONS > Root project

⚠️ Only in second (1):

  • CUSTOM_NEW

❌ SETTINGS > Root project > "Debug" configuration > Base configuration

⚠️ Value mismatch (1):

  • Path to .xcconfig

    • nil
    • Project/Project.xcconfig

❌ SETTINGS > Root project > "Debug" configuration > Values

⚠️ Only in second (1):

  • CUSTOM_SETTGING_1

✅ SETTINGS > Root project > "Release" configuration > Base configuration

❌ SETTINGS > Root project > "Release" configuration > Values

⚠️ Only in second (1):

  • CUSTOM_SETTGING_1

✅ SETTINGS > "MismatchingLibrary" target > "Debug" configuration > Base configuration

❌ SETTINGS > "MismatchingLibrary" target > "Debug" configuration > Values

⚠️ Only in first (1):

  • OTHER_LDFLAGS

⚠️ Only in second (13):

  • CLANG_ENABLE_MODULES
  • CURRENT_PROJECT_VERSION
  • DEFINES_MODULE
  • DYLIB_COMPATIBILITY_VERSION
  • DYLIB_CURRENT_VERSION
  • DYLIB_INSTALL_NAME_BASE
  • INFOPLIST_FILE
  • INSTALL_PATH
  • LD_RUNPATH_SEARCH_PATHS
  • PRODUCT_BUNDLE_IDENTIFIER
  • SWIFT_OPTIMIZATION_LEVEL
  • VERSIONING_SYSTEM
  • VERSION_INFO_PREFIX

⚠️ Value mismatch (1):

  • PRODUCT_NAME

    • $(TARGET_NAME)
    • $(TARGET_NAME:c99extidentifier)

✅ SETTINGS > "MismatchingLibrary" target > "Release" configuration > Base configuration

❌ SETTINGS > "MismatchingLibrary" target > "Release" configuration > Values

⚠️ Only in first (1):

  • OTHER_LDFLAGS

⚠️ Only in second (12):

  • CLANG_ENABLE_MODULES
  • CURRENT_PROJECT_VERSION
  • DEFINES_MODULE
  • DYLIB_COMPATIBILITY_VERSION
  • DYLIB_CURRENT_VERSION
  • DYLIB_INSTALL_NAME_BASE
  • INFOPLIST_FILE
  • INSTALL_PATH
  • LD_RUNPATH_SEARCH_PATHS
  • PRODUCT_BUNDLE_IDENTIFIER
  • VERSIONING_SYSTEM
  • VERSION_INFO_PREFIX

⚠️ Value mismatch (1):

  • PRODUCT_NAME

    • $(TARGET_NAME)
    • $(TARGET_NAME:c99extidentifier)

❌ SETTINGS > "Project" target > "Debug" configuration > Base configuration

⚠️ Value mismatch (1):

  • Path to .xcconfig

    • nil
    • Project/Target.xcconfig

❌ SETTINGS > "Project" target > "Debug" configuration > Values

⚠️ Only in second (1):

  • ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES

⚠️ Value mismatch (1):

  • CUSTOM_SETTING_COMMON

    • VALUE_1
    • VALUE_2

✅ SETTINGS > "Project" target > "Release" configuration > Base configuration

❌ SETTINGS > "Project" target > "Release" configuration > Values

⚠️ Only in second (1):

  • ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES

⚠️ Value mismatch (1):

  • CUSTOM_SETTING_COMMON

    • VALUE_1
    • VALUE_2

✅ SETTINGS > "ProjectFramework" target > "Debug" configuration > Base configuration

❌ SETTINGS > "ProjectFramework" target > "Debug" configuration > Values

⚠️ Value mismatch (1):

  • PRODUCT_BUNDLE_IDENTIFIER

    • com.bloomberg.xcdiff.Project.testprovisioning.ProjectFramework
    • com.bloomberg.xcdiff.Project.ProjectFramework

✅ SETTINGS > "ProjectFramework" target > "Release" configuration > Base configuration

❌ SETTINGS > "ProjectFramework" target > "Release" configuration > Values

⚠️ Value mismatch (1):

  • PRODUCT_BUNDLE_IDENTIFIER

    • com.bloomberg.xcdiff.Project.testprovisioning.ProjectFramework
    • com.bloomberg.xcdiff.Project.ProjectFramework

✅ SETTINGS > "ProjectTests" target > "Debug" configuration > Base configuration

✅ SETTINGS > "ProjectTests" target > "Debug" configuration > Values

✅ SETTINGS > "ProjectTests" target > "Release" configuration > Base configuration

✅ SETTINGS > "ProjectTests" target > "Release" configuration > Values

✅ SETTINGS > "ProjectUITests" target > "Debug" configuration > Base configuration

✅ SETTINGS > "ProjectUITests" target > "Debug" configuration > Values

✅ SETTINGS > "ProjectUITests" target > "Release" configuration > Base configuration

✅ SETTINGS > "ProjectUITests" target > "Release" configuration > Values

❌ SOURCE_TREES > Root project

Output format: (<path>, <name>, <source_tree>)

⚠️ Only in first (8):

  • (AViewController.xib, nil, <group>) → (Group B, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)
  • (AnotherObjcClass.h, nil, <group>) → (Group B, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)
  • (AnotherObjcClass.m, nil, <group>) → (Group B, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)
  • (BarTests.swift, nil, <group>) → (ProjectTests, nil, <group>) → (nil, nil, <group>)
  • (LoginTests.swift, nil, <group>) → (ProjectUITests, nil, <group>) → (nil, nil, <group>)
  • (empty.png, nil, <group>) → (Screenshots, nil, <group>) → (ProjectUITests, nil, <group>) → (nil, nil, <group>)
  • (libMismatchingLibrary.a, nil, BUILT_PRODUCTS_DIR) → (nil, Products, <group>) → (nil, nil, <group>)
  • (time.png, nil, <group>) → (Resources, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)

⚠️ Only in second (11):

  • (Header4.h, nil, <group>) → (ProjectFramework, nil, <group>) → (nil, nil, <group>)
  • (Info.plist, nil, <group>) → (NewFramework, nil, <group>) → (nil, nil, <group>)
  • (ListResponse.json, nil, <group>) → (Responses, nil, <group>) → (ProjectTests, nil, <group>) → (nil, nil, <group>)
  • (MetricsTests.swift, nil, <group>) → (ProjectUITests, nil, <group>) → (nil, nil, <group>)
  • (MismatchingLibrary-Info.plist, nil, <group>) → (MismatchingLibrary, nil, <group>) → (nil, nil, <group>)
  • (MismatchingLibrary.framework, nil, BUILT_PRODUCTS_DIR) → (nil, Products, <group>) → (nil, nil, <group>)
  • (NewFramework.framework, nil, BUILT_PRODUCTS_DIR) → (nil, Products, <group>) → (nil, nil, <group>)
  • (NewFramework.h, nil, <group>) → (NewFramework, nil, <group>) → (nil, nil, <group>)
  • (Project.xcconfig, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)
  • (README.md, nil, <group>) → (nil, nil, <group>)
  • (Target.xcconfig, nil, <group>) → (Project, nil, <group>) → (nil, nil, <group>)

✅ LINKED_DEPENDENCIES > "MismatchingLibrary" target

❌ LINKED_DEPENDENCIES > "Project" target

⚠️ Only in second (2):

  • MismatchingLibrary.framework
  • NewFramework.framework

⚠️ Value mismatch (1):

  • ARKit.framework attributes

    • required
    • optional

✅ LINKED_DEPENDENCIES > "ProjectFramework" target

✅ LINKED_DEPENDENCIES > "ProjectTests" target

✅ LINKED_DEPENDENCIES > "ProjectUITests" target

diff --git a/Documentation/CLI.md b/Documentation/CLI.md index 68b23ce..d57b58b 100644 --- a/Documentation/CLI.md +++ b/Documentation/CLI.md @@ -53,6 +53,7 @@ There are three output formats: - `console` (default, if `-f` is not specified) - `json` - `markdown` +- `html` ```sh xcdiff -f markdown # alternatively json or console diff --git a/Sources/XCDiffCore/ResultRenderer/ProjectResultRenderer/TextProjectCompareResultRenderer.swift b/Sources/XCDiffCore/ResultRenderer/ProjectResultRenderer/TextProjectCompareResultRenderer.swift index 6ab6d9b..5b7a8a3 100644 --- a/Sources/XCDiffCore/ResultRenderer/ProjectResultRenderer/TextProjectCompareResultRenderer.swift +++ b/Sources/XCDiffCore/ResultRenderer/ProjectResultRenderer/TextProjectCompareResultRenderer.swift @@ -55,8 +55,8 @@ final class TextProjectCompareResultRenderer: ProjectCompareResultRenderer { // render only in first let onlyInFirst = result.onlyInFirst if !onlyInFirst.isEmpty { - renderer.header("⚠️ Only in first\(string(from: onlyInFirst.count)):", .h3) - renderer.section(.default) { + renderer.header("⚠️ Only in first (\(onlyInFirst.count)):", .h3) + renderer.section(.content) { renderer.list { onlyInFirst.forEach { renderer.item($0) @@ -68,8 +68,8 @@ final class TextProjectCompareResultRenderer: ProjectCompareResultRenderer { // render only in second let onlyInSecond = result.onlyInSecond if !onlyInSecond.isEmpty { - renderer.header("⚠️ Only in second\(string(from: onlyInSecond.count)):", .h3) - renderer.section(.default) { + renderer.header("⚠️ Only in second (\(onlyInSecond.count)):", .h3) + renderer.section(.content) { renderer.list { onlyInSecond.forEach { renderer.item($0) @@ -81,8 +81,8 @@ final class TextProjectCompareResultRenderer: ProjectCompareResultRenderer { // render different values let differentValues = result.differentValues if !differentValues.isEmpty { - renderer.header("⚠️ Value mismatch\(string(from: differentValues.count)):", .h3) - renderer.section(.default) { + renderer.header("⚠️ Value mismatch (\(differentValues.count)):", .h3) + renderer.section(.content) { renderer.list { differentValues.forEach { item in renderer.item { @@ -109,11 +109,4 @@ final class TextProjectCompareResultRenderer: ProjectCompareResultRenderer { let subContext = !result.context.isEmpty ? " > " + result.context.joined(separator: " > ") : "" return rootContext + subContext } - - private func string(from count: Int?) -> String { - guard let count = count else { - return "" - } - return " (\(count))" - } } diff --git a/Sources/XCDiffCore/ResultRenderer/Renderer/HTMLRenderer.swift b/Sources/XCDiffCore/ResultRenderer/Renderer/HTMLRenderer.swift index 9978f16..b074c4f 100644 --- a/Sources/XCDiffCore/ResultRenderer/Renderer/HTMLRenderer.swift +++ b/Sources/XCDiffCore/ResultRenderer/Renderer/HTMLRenderer.swift @@ -114,7 +114,7 @@ final class HTMLRenderer: Renderer {
-

Diff Results

+

Δ xcdiff result

""" @@ -140,11 +140,12 @@ final class HTMLRenderer: Renderer { } func section(_ style: RendererElement.Style, _ content: () -> Void) { - switch style { + let cssClass = self.cssClass(from: style) + switch cssClass { case .success, .warning: - tag("section", cssClass(from: style), content) - case .default: - tag("div", .content, content) + tag("section", cssClass, content) + case .content: + tag("div", cssClass, content) } } @@ -229,10 +230,10 @@ final class HTMLRenderer: Renderer { } } - private func cssClass(from style: RendererElement.Style) -> CSSClass? { + private func cssClass(from style: RendererElement.Style) -> CSSClass { switch style { - case .default: - return nil + case .content: + return .content case .success: return .success case .warning: diff --git a/Sources/XCDiffCore/ResultRenderer/Renderer/Renderer.swift b/Sources/XCDiffCore/ResultRenderer/Renderer/Renderer.swift index 512b8bd..95a31ce 100644 --- a/Sources/XCDiffCore/ResultRenderer/Renderer/Renderer.swift +++ b/Sources/XCDiffCore/ResultRenderer/Renderer/Renderer.swift @@ -24,7 +24,7 @@ struct RendererElement { } enum Style { - case `default` + case content case success case warning }