MCPcopy Index your code
hub / github.com/python/mypy / visit_mypy_file

Method visit_mypy_file

mypy/strconv.py:105–119  ·  view source on GitHub ↗
(self, o: mypy.nodes.MypyFile)

Source from the content-addressed store, hash-verified

103 # Top-level structures
104
105 def visit_mypy_file(self, o: mypy.nodes.MypyFile) -> str:
106 # Skip implicit definitions.
107 a: list[Any] = [o.defs]
108 if o.is_bom:
109 a.insert(0, "BOM")
110 # Omit path to special file with name "main". This is used to simplify
111 # test case descriptions; the file "main" is used by default in many
112 # test cases.
113 if o.path != "main":
114 # Insert path. Normalize directory separators to / to unify test
115 # case# output in all platforms.
116 a.insert(0, o.path.replace(os.getcwd() + os.sep, "").replace(os.sep, "/"))
117 if o.ignored_lines:
118 a.append("IgnoredLines(%s)" % ", ".join(str(line) for line in sorted(o.ignored_lines)))
119 return self.dump(a, o)
120
121 def visit_import(self, o: mypy.nodes.Import) -> str:
122 a = []

Callers 1

acceptMethod · 0.45

Calls 7

dumpMethod · 0.95
strClass · 0.85
sortedFunction · 0.85
insertMethod · 0.80
replaceMethod · 0.80
appendMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected