src/nitpick/formats.py
def compare_with_flatten(self, expected: Union[JsonDict, "BaseFormat"] = None) -> Comparison:
        """Compare two flattened dictionaries and compute missing and different items."""
        comparison = self._create_comparison(expected)
        if comparison.flat_expected.items() <= comparison.flat_actual.items():
            return comparison

        comparison.set_missing(
            unflatten({k: v for k, v in comparison.flat_expected.items() if k not in comparison.flat_actual})
        )
        comparison.set_diff(
            unflatten(
                {
                    k: v
                    for k, v in comparison.flat_expected.items()
                    if k in comparison.flat_actual and v != comparison.flat_actual[k]
                }
            )
        )
        return comparison
Compare two flattened dictionaries and compute missing and different items.
Compare two flattened dictionaries and compute missing and different items.
Compare two flattened dictionaries and compute missing and different items .
def compare_with_flatten(self, expected: Union[JsonDict, "BaseFormat"] = None) -> Comparison:
        comparison = self._create_comparison(expected)
        if comparison.flat_expected.items() <= comparison.flat_actual.items():
            return comparison
        comparison.set_missing(
            unflatten({k: v for k, v in comparison.flat_expected.items() if k not in comparison.flat_actual})
        )
        comparison.set_diff(
            unflatten(
                {
                    k: v
                    for k, v in comparison.flat_expected.items()
                    if k in comparison.flat_actual and v != comparison.flat_actual[k]
                }
            )
        )
        return comparison
def compare_with_flatten ( self , expected : Union [ JsonDict , "BaseFormat" ] = None ) -> Comparison : comparison = self . _create_comparison ( expected ) if comparison . flat_expected . items ( ) <= comparison . flat_actual . items ( ) : return comparison comparison . set_missing ( unflatten ( { k : v for k , v in comparison . flat_expected . items ( ) if k not in comparison . flat_actual } ) ) comparison . set_diff ( unflatten ( { k : v for k , v in comparison . flat_expected . items ( ) if k in comparison . flat_actual and v != comparison . flat_actual [ k ] } ) ) return comparison
Compare two flattened dictionaries and compute missing and different items.
Compare two flattened dictionaries and compute missing and different items .
"""Compare two flattened dictionaries and compute missing and different items."""
self
expected
Union[JsonDict, "BaseFormat"]