MCPcopy
hub / github.com/treeverse/dvc / init

Function init

dvc/ignore.py:555–567  ·  view source on GitHub ↗
(path: Union[str, os.PathLike[str]])

Source from the content-addressed store, hash-verified

553
554
555def init(path: Union[str, os.PathLike[str]]) -> str:
556 dvcignore = os.path.join(path, DvcIgnore.DVCIGNORE_FILE)
557 if os.path.exists(dvcignore):
558 return dvcignore
559
560 with open(dvcignore, "w", encoding="utf-8") as fobj:
561 fobj.write(
562 "# Add patterns of files dvc should ignore, which could improve\n"
563 "# the performance. Learn more at\n"
564 "# https://dvc.org/doc/user-guide/dvcignore\n"
565 )
566
567 return dvcignore
568
569
570def destroy(path: Union[str, os.PathLike[str]]) -> None:

Callers

nothing calls this directly

Calls 4

openFunction · 0.85
joinMethod · 0.80
writeMethod · 0.80
existsMethod · 0.45

Tested by

no test coverage detected