1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-18 20:11:17 +00:00

Add a test.py rule

This commit is contained in:
mcarton 2015-06-26 14:04:25 +02:00
parent 3203d57b36
commit 369ea7ff46
2 changed files with 11 additions and 0 deletions

View File

@ -189,6 +189,7 @@ using the matched rule and runs it. Rules enabled by default are as follows:
* `sudo` – prepends `sudo` to previous command if it failed because of permissions;
* `switch_layout` – switches command from your local layout to en;
* `systemctl` – correctly orders parameters of confusing systemctl;
* `test.py` &ndasg; runs `py.test` instead of `test.py`;
* `whois` – fixes `whois` command.
Enabled by default only on specific platforms:

10
thefuck/rules/test.py.py Normal file
View File

@ -0,0 +1,10 @@
def match(command, settings):
return command.script == 'test.py' and 'not found' in command.stderr
def get_new_command(command, settings):
return 'py.test'
# make it come before the python_command rule
priority = 900