How to use the thefuck.utils.for_app function in thefuck

To help you get started, we’ve selected a few thefuck 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 nvbn / thefuck / thefuck / rules / brew_link.py View on Github external
@for_app('brew', at_least=2)
def match(command):
    return (command.script_parts[1] in ['ln', 'link']
            and "brew link --overwrite --dry-run" in command.output)
github nvbn / thefuck / thefuck / rules / python_execute.py View on Github external
@for_app('python')
def match(command):
    return not command.script.endswith('.py')
github nvbn / thefuck / thefuck / rules / javac.py View on Github external
@for_app('javac')
def match(command):
    return not command.script.endswith('.java')
github nvbn / thefuck / thefuck / rules / prove_recursively.py View on Github external
@for_app('prove')
def match(command):
    return (
        'NOTESTS' in command.output
        and not any(_is_recursive(part) for part in command.script_parts[1:])
        and any(_isdir(part) for part in command.script_parts[1:]))
github nvbn / thefuck / thefuck / rules / sed_unterminated_s.py View on Github external
@for_app('sed')
def match(command):
    return "unterminated `s' command" in command.output
github nvbn / thefuck / thefuck / rules / brew_update_formula.py View on Github external
@for_app('brew', at_least=2)
def match(command):
    return ('update' in command.script
            and "Error: This command updates brew itself" in command.output
            and "Use 'brew upgrade '" in command.output)
github nvbn / thefuck / thefuck / rules / ls_all.py View on Github external
@for_app('ls')
def match(command):
    return command.output.strip() == ''
github nvbn / thefuck / thefuck / rules / mvn_unknown_lifecycle_phase.py View on Github external
@for_app('mvn')
def match(command):
    failed_lifecycle = _get_failed_lifecycle(command)
    available_lifecycles = _getavailable_lifecycles(command)
    return available_lifecycles and failed_lifecycle
github nvbn / thefuck / thefuck / rules / go_run.py View on Github external
@for_app('go')
def match(command):
    return (command.script.startswith('go run ')
            and not command.script.endswith('.go'))
github nvbn / thefuck / thefuck / rules / yarn_command_not_found.py View on Github external
@for_app('yarn')
def match(command):
    return regex.findall(command.stderr)