How to use the vulture.core.Vulture function in vulture

To help you get started, we’ve selected a few vulture examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CountryTk / Hydra / src / widgets / Events.py View on Github external
def look_for_dead_code(self, text):
        self.vultureObject = Vulture()
        self.vultureObject.scan(text)

        with io.StringIO() as buf, redirect_stdout(buf):
            self.vultureObject.report()
            output = buf.getvalue()

        info = output.replace(':', '').split()
        formatted_info = []
        unformatted_info = []
        for word in info:
            try:
                integer = int(word)
                new_word = "<h5 style="\&quot;color:">Line {} </h5>".format(integer)
                formatted_info.append("\n")
                formatted_info.append(new_word)
                unformatted_info.append("\n")
github jendrikseipp / vulture / vulture / core.py View on Github external
def main():
    args = _parse_args()
    vulture = Vulture(verbose=args.verbose, ignore_names=args.ignore_names,
                      ignore_decorators=args.ignore_decorators)
    vulture.scavenge(args.paths, exclude=args.exclude)
    sys.exit(vulture.report(
        min_confidence=args.min_confidence,
        sort_by_size=args.sort_by_size,
        make_whitelist=args.make_whitelist))
github jendrikseipp / vulture / vulture / __init__.py View on Github external
from vulture.core import __version__, Vulture

assert __version__
assert Vulture