How to use the vulture.noqa.parse_noqa 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 jayclassless / tidypy / src / tidypy / tools / vulture.py View on Github external
def scan(self, code, filename=''):
        code = sanitize_code(code)
        self.code = code.splitlines()
        self.noqa_lines = noqa.parse_noqa(self.code)
        self.filename = filename
        try:
            node = parse_python_file(self.filename)
        except (SyntaxError, TypeError, ValueError) as err:
            self._tidypy_issues.append(ParseIssue(err, self.filename))
            self.found_dead_code_or_error = True
        else:
            self.visit(node)