#1210: Add rule 'rails_migrations_pending'
* Add rule 'rails_migrations_pending' * Update thefuck/rules/rails_migrations_pending.py Co-authored-by: Pablo Aguiar <scorphus@gmail.com> * Add initial command to corrected command Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import re
|
||||
from thefuck.shells import shell
|
||||
|
||||
|
||||
SUGGESTION_REGEX = r"To resolve this issue, run:\s+(.*?)\n"
|
||||
|
||||
|
||||
def match(command):
|
||||
return "Migrations are pending. To resolve this issue, run:" in command.output
|
||||
|
||||
|
||||
def get_new_command(command):
|
||||
migration_script = re.search(SUGGESTION_REGEX, command.output).group(1)
|
||||
return shell.and_(migration_script, command.script)
|
||||
Reference in New Issue
Block a user