MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / assert_dependencies

Method assert_dependencies

code2flow/javascript.py:248–258  ·  view source on GitHub ↗

Assert that acorn is installed and the correct version

()

Source from the content-addressed store, hash-verified

246class Javascript(BaseLanguage):
247 @staticmethod
248 def assert_dependencies():
249 """Assert that acorn is installed and the correct version"""
250 assert is_installed('acorn'), "Acorn is required to parse javascript files " \
251 "but was not found on the path. Install it " \
252 "from npm and try again."
253 version = get_acorn_version()
254 if not version.startswith('8.'):
255 logging.warning("Acorn is required to parse javascript files. "
256 "Version %r was found but code2flow has only been "
257 "tested on 8.*", version)
258 logging.info("Using Acorn %s" % version)
259
260 @staticmethod
261 def get_tree(filename, lang_params):

Callers

nothing calls this directly

Calls 2

is_installedFunction · 0.85
get_acorn_versionFunction · 0.85

Tested by

no test coverage detected