MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / nfc

Function nfc

graphify/paths.py:711–720  ·  view source on GitHub ↗

NFC-normalize a path string. macOS (HFS+/APFS) reports filenames in NFD while manifests, graph ``source_file`` entries and user input are typically NFC. Comparing raw strings makes the same file look like two different paths, so any path membership test must normalize BOTH sides (#2

(s: str)

Source from the content-addressed store, hash-verified

709
710
711def nfc(s: str) -> str:
712 """NFC-normalize a path string.
713
714 macOS (HFS+/APFS) reports filenames in NFD while manifests, graph
715 ``source_file`` entries and user input are typically NFC. Comparing raw
716 strings makes the same file look like two different paths, so any path
717 membership test must normalize BOTH sides (#2210, #2221/#2224).
718 """
719 import unicodedata
720 return unicodedata.normalize("NFC", s)
721
722
723def read_graph_json(path) -> dict:

Callers 7

relFunction · 0.90
_stale_graph_sourcesFunction · 0.90
_in_seenFunction · 0.90
_provably_excludedFunction · 0.90
_absFunction · 0.90

Calls 1

normalizeMethod · 0.80

Tested by

no test coverage detected