How to use the pyflakes.messages.ReturnWithArgsInsideGenerator function in pyflakes

To help you get started, we’ve selected a few pyflakes 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 mozilla / version-control-tools / pylib / pyflakes / pyflakes / checker.py View on Github external
def checkReturnWithArgumentInsideGenerator():
                    """
                    Check to see if there is any return statement with
                    arguments but the function is a generator.
                    """
                    if self.scope.isGenerator and self.scope.returnValue:
                        self.report(messages.ReturnWithArgsInsideGenerator,
                                    self.scope.returnValue)
                self.deferAssignment(checkReturnWithArgumentInsideGenerator)
github marslo / myvim / Configurations / Offline_Packages / bundle / pyflakes / pyflakes / checker.py View on Github external
def checkReturnWithArgumentInsideGenerator():
                    """
                    Check to see if there is any return statement with
                    arguments but the function is a generator.
                    """
                    if self.scope.isGenerator and self.scope.returnValue:
                        self.report(messages.ReturnWithArgsInsideGenerator,
                                    self.scope.returnValue)
                self.deferAssignment(checkReturnWithArgumentInsideGenerator)
github klen / pylama / pylama / lint / pylama_pyflakes / pyflakes / checker.py View on Github external
def checkReturnWithArgumentInsideGenerator():
                    """
                    Check to see if there is any return statement with
                    arguments but the function is a generator.
                    """
                    if self.scope.isGenerator and self.scope.returnValue:
                        self.report(messages.ReturnWithArgsInsideGenerator,
                                    self.scope.returnValue)
                self.deferAssignment(checkReturnWithArgumentInsideGenerator)
github QQuick / Transcrypt / transcrypt / modules / org / transcrypt / static_check / pyflakes / pyflakes / checker.py View on Github external
def checkReturnWithArgumentInsideGenerator():
                    """
                    Check to see if there is any return statement with
                    arguments but the function is a generator.
                    """
                    if self.scope.isGenerator and self.scope.returnValue:
                        self.report(messages.ReturnWithArgsInsideGenerator,
                                    self.scope.returnValue)
                self.deferAssignment(checkReturnWithArgumentInsideGenerator)
github mdn / kuma / vendor / packages / pyflakes / checker.py View on Github external
def checkReturnWithArgumentInsideGenerator():
                    """
                    Check to see if there is any return statement with
                    arguments but the function is a generator.
                    """
                    if self.scope.isGenerator and self.scope.returnValue:
                        self.report(messages.ReturnWithArgsInsideGenerator,
                                    self.scope.returnValue)
                self.deferAssignment(checkReturnWithArgumentInsideGenerator)
github robmadole / jig-plugins / pyflakes / lib / pyflakes / checker.py View on Github external
def checkReturnWithArgumentInsideGenerator():
                    """
                    Check to see if there is any return statement with
                    arguments but the function is a generator.
                    """
                    if self.scope.isGenerator and self.scope.returnValue:
                        self.report(messages.ReturnWithArgsInsideGenerator,
                                    self.scope.returnValue)
                self.deferAssignment(checkReturnWithArgumentInsideGenerator)
github marslo / myvim / Configurations / Offline_Packages / bundle / python-mode / submodules / pyflakes / pyflakes / checker.py View on Github external
def checkReturnWithArgumentInsideGenerator():
                    """
                    Check to see if there is any return statement with
                    arguments but the function is a generator.
                    """
                    if self.scope.isGenerator and self.scope.returnValue:
                        self.report(messages.ReturnWithArgsInsideGenerator,
                                    self.scope.returnValue)
                self.deferAssignment(checkReturnWithArgumentInsideGenerator)
github pylava / pylava / pylama / lint / pylama_pyflakes / pyflakes / checker.py View on Github external
def checkReturnWithArgumentInsideGenerator():
                    """
                    Check to see if there is any return statement with
                    arguments but the function is a generator.
                    """
                    if self.scope.isGenerator and self.scope.returnValue:
                        self.report(messages.ReturnWithArgsInsideGenerator,
                                    self.scope.returnValue)
                self.deferAssignment(checkReturnWithArgumentInsideGenerator)
github jmwright / cadquery-freecad-module / CadQuery / Libs / pyqode / python / backend / workers.py View on Github external
_logger().exception('Failed to run PEP8 analysis with data=%r'
                            % request_data)
        return []
    else:
        messages = []
        for line_number, offset, code, text, doc in results:
            if code in ['W291', 'W292', 'W293', 'W391']:
                continue
            messages.append(('[PEP8] %s: %s' % (code, text), WARNING,
                             line_number - 1))
        return messages


PYFLAKES_ERROR_MESSAGES = [
    messages.DoctestSyntaxError,
    messages.ReturnWithArgsInsideGenerator,
    messages.UndefinedExport,
    messages.UndefinedName,
    messages.UndefinedLocal
]


def run_pyflakes(request_data):
    """
    Worker that run a frosted (the fork of pyflakes) code analysis on the
    current editor text.
    """
    global prev_results
    from pyflakes import checker
    import _ast
    WARNING = 1
    ERROR = 2