src/nitpick/formats.py
def load(self) -> bool:
        """Load a JSON file by its path, a string or a dict."""
        if self._loaded:
            return False
        if self.path is not None:
            self._string = Path(self.path).read_text()
        if self._string is not None:
            self._data = json.loads(self._string, object_pairs_hook=OrderedDict)
        if self._data is not None:
            if isinstance(self._data, BaseFormat):
                self._reformatted = self._data.reformatted
            else:
                self._reformatted = json.dumps(self._data, sort_keys=True, indent=2)
        self._loaded = True
        return True
Load a JSON file by its path, a string or a dict.
Load a JSON file by its path, a string or a dict.
Load a JSON file by its path a string or a dict .
def load(self) -> bool:
        if self._loaded:
            return False
        if self.path is not None:
            self._string = Path(self.path).read_text()
        if self._string is not None:
            self._data = json.loads(self._string, object_pairs_hook=OrderedDict)
        if self._data is not None:
            if isinstance(self._data, BaseFormat):
                self._reformatted = self._data.reformatted
            else:
                self._reformatted = json.dumps(self._data, sort_keys=True, indent=2)
        self._loaded = True
        return True
def load ( self ) -> bool : if self . _loaded : return False if self . path is not None : self . _string = Path ( self . path ) . read_text ( ) if self . _string is not None : self . _data = json . loads ( self . _string , object_pairs_hook = OrderedDict ) if self . _data is not None : if isinstance ( self . _data , BaseFormat ) : self . _reformatted = self . _data . reformatted else : self . _reformatted = json . dumps ( self . _data , sort_keys = True , indent = 2 ) self . _loaded = True return True
Load a JSON file by its path, a string or a dict.
Load a JSON file by its path a string or a dict .
"""Load a JSON file by its path, a string or a dict."""
self