MCPcopy
hub / github.com/psf/black / get_file_data

Method get_file_data

src/black/cache.py:95–100  ·  view source on GitHub ↗

Return file data for path.

(path: Path)

Source from the content-addressed store, hash-verified

93
94 @staticmethod
95 def get_file_data(path: Path) -> FileData:
96 """Return file data for path."""
97
98 stat = path.stat()
99 hash = Cache.hash_digest(path)
100 return FileData(stat.st_mtime, stat.st_size, hash)
101
102 def is_changed(self, source: Path) -> bool:
103 """Check if source has changed compared to cached version."""

Callers 1

writeMethod · 0.80

Calls 2

FileDataClass · 0.85
hash_digestMethod · 0.80

Tested by

no test coverage detected