1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-06 02:41:10 +01:00
Commit Graph

398 Commits

Author SHA1 Message Date
Pablo Aguiar
80cfd6991d #N/A: Add new git_branch_delete_checked_out rule (#985) 2019-10-23 00:30:17 +02:00
ik1ne
0ccb34bde8 Support for yum invalid commands. (#968)
* - Add skeleton code for yum_invalid_operation.py
- Add test for rule/yum_invalid_operation

* Add: mocker for subprocess.Popen.

* Fix: invalid yum_operations.

* Fix: Added missing fixtures.

* Add: yum_invalid_operation implementation.

* Add: enabled_by_default variable for rules/yum_invalid_operation.

* Update Readme.
2019-10-19 15:05:22 +02:00
ik1ne
581a292797 Add support for switch_lang for Korean. (#981)
* switch korean letters to english

* revised according to recent changes

* Fix typo in tests/test_switch_lang.py

* Add a test case for coverage

* Change: Moved decomposing logic which changes command.script to get_new_command instead of match.

* Fix: changed unicode characters to unicode string for python2 compatibility.

* Fix: Modified to change request.

@ik1ne @yangkyeongmo
2019-10-19 15:03:21 +02:00
thatneat
3bbd0e9463 Correct "apt uninstall" -> "apt remove" (#950)
* Correct "apt uninstall" -> "apt remove"

* remove unused import
2019-09-17 20:02:45 +02:00
ik1ne
84c16fb69a Change: rules_git_checkout handling branch names with slashes & Remote HEAD. (#944)
* Add: Test for branch names with slashes & Remote HEAD.

* - Add: Handling for removing remote HEAD.
- Change: Improved handling for branches with slash in their names.
2019-09-02 19:16:40 +02:00
ik1ne
1683f45e94 Update docker commands. (#940)
* Add: Tests for newer version docker support.

* Add: Support for newer versions of docker (Modified rules.docker_not_command).

* Fix: Updated disabling memoize.

* Change: removed empty list check.

* Fix: _parse_commands now uses line.strip() internally and ends_with arg now doesn't end with newline.

* Change: Replaced disable_memoize in favor of no_memoize fixture.

* Fix: removed unused import.
2019-08-21 20:35:55 +02:00
ik1ne
d88454a638 Add: rules/go_unknown_command for misspelled go commands. (#933)
* - Add: rules/go_unknown_command for misspelled go commands.
- Add: tests/test_go_unknown_command which tests match and mismatch case of rules/go_unknown_command.
- Change: Added description of go_unknown_command to README.md.

* Add: test_get_new_command for testing rules.go_unknown_command.test_get_new_command method.

* Change: go_unknown_command.match now uses for_app decorator.

* Add: get_golang_commands which dynamically gets golang possible commands.

* Fix: cache proper function instead of its result.
2019-08-21 20:34:34 +02:00
tobixx
3bbe391391 Only consider raw command in output (#931)
* Only consider raw command in output match

... else it will not work for localized messages.

Example German output:
```
Führen Sie »apt list --upgradable« aus, um sie anzuzeigen.
```

* added german output test

* make the linter happy
2019-08-19 21:39:14 +02:00
Connor Martin
01a5ba99d0 Docker remove container before remove image (#928)
* add docker container removal

* remove container before deleting image

* update readme

* clean up and add assert not test

* test not docker command

* use shell.and_ correctly
2019-07-10 20:34:20 +02:00
Mathieu Cantin
4c3a559124 Added rules to run terraform init before terraform plan or apply (#924)
* Run terraform init to initialize terraform modules

* Fix indent

* Add unit tests for terraform_init.py
2019-06-26 20:02:01 +02:00
Tycho Grouwstra
48e1e4217f support nixos command-not-found, closes #912 (#922) 2019-06-26 20:01:02 +02:00
Pablo Aguiar
ba949f7fd9 #N/A: Add pyenv_no_such_command rule (#919) 2019-05-27 18:23:45 +02:00
Pablo Aguiar
5efcf1019f #N/A: Improve support to Windows in no_command rule (#918)
Windows “not found” message is quite different from POSIX systems.
2019-05-27 18:23:06 +02:00
Jesus Cuesta
201c01fc74 Adding yay AUR manager to Arch Linux's commands since yaourt is unmaintained and has some security issues. (#907) 2019-05-21 20:49:04 +02:00
Inga Feick
82902fb50d Add rule for pip_install permission fix (#895)
* Add rule for pip_install permission fix

* Fix whitespace

* Switch quotation to single

* remove 2nd else

* E261 indent comment
2019-04-24 18:15:38 +02:00
Inga Feick
828ae537da Docker login (#894)
* Add docker_login rule

* Add docker_login rule

* Whitespace fix

* Fix typo in test case

* Fix typo in test case

* Add test cases
2019-04-04 00:01:14 +02:00
Aiden Song
1208faaabb #N/A: Add rule for git commit that reverts previous commit (#886) 2019-02-25 23:24:16 +01:00
Vladimir Iakovlev
5b3350b2dd #N/A: Fix tests with py.test 4 2018-11-21 19:43:01 +01:00
Pablo Aguiar
e6be00a63b Comply to new flake8 3.6 (#853)
* #N/A: Ignore W504 line break after binary operator

W504 is now part of flake8 current version 3.6

* #N/A: Fix invalid escape sequences

* #N/A: Remove conflicting path before installing gcc with brew
2018-10-30 20:56:55 +01:00
James Turnbull
926e9ef963 Added a rule to match az binary sub-command misses (#834) 2018-08-16 00:22:24 +02:00
Pablo Aguiar
cc6d90963e #367: Support BSD style output in touch rule (#830)
On a Mac, also on NetBSD or OpenBSD, `touch` errs differently:

```
$ uname; touch a/b/c
Darwin
touch: a/b/c: No such file or directory
```

That gets matched by the rule but not fixed by it. Thus the regex
pattern is now a bit more tolerant.
2018-07-29 18:18:42 +02:00
Scott Colby
1dfd6373ee Stop parsing language-variable cat output to make cat_dir more reliable. (#827)
* Stop parsing language-variable cat output to make cat_dir more reliable.

* Add missing semicolon in readme
2018-07-11 23:47:06 +02:00
Scott Colby
fe0785bc42 Create cat_dir rule for replacing cat with ls (#823)
* Create `cat_dir` rule for replacing `cat` with `ls` when you try to run `cat` on a directory.

* Changed to string methods in response to feedback.

Added a test to make sure lines like 'cat cat' don't become 'ls ls'.

Added trailing '\n's to test cases.
2018-07-10 00:51:42 +02:00
Matthieu Guilbert
534782414f git_push: Handle command containing force argument (#818) 2018-07-10 00:48:08 +02:00
Iulian Onofrei
89207d6d7c Add brew_reinstall rule (#816)
Replaces install with reinstall when a package is already installed.
2018-05-22 19:25:05 +02:00
Vladimir Iakovlev
81042514c8 Squashed commit of the following:
commit 6919161e77a39b9bd59ca54eac44b956cd3ae1dc
Author: Vladimir Iakovlev <nvbn.rm@gmail.com>
Date:   Tue May 22 19:01:33 2018 +0200

    #810: Fix code style

commit ebbb31a3227ce32ba5288e96c0c16a3d334c45d6
Merge: 2df1a5a a2799ad
Author: Vladimir Iakovlev <nvbn.rm@gmail.com>
Date:   Tue May 22 18:59:56 2018 +0200

    Merge branch 'feature/long-form-help' of https://github.com/jakewarren/thefuck into jakewarren-feature/long-form-help

commit a2799ad098
Author: Jake Warren <jakewarren@users.noreply.github.com>
Date:   Mon May 7 14:12:57 2018 -0500

    Add new `long_form_help` rule
2018-05-22 19:01:51 +02:00
Vladimir Iakovlev
284d49da8d #786: Fix tests 2018-02-23 21:15:05 +01:00
Vladimir Iakovlev
ed24e4ca61 Squashed commit of the following:
commit 8573f94c2f3ba17ec5d7dd123338c14a550e57e6
Author: Vladimir Iakovlev <nvbn.rm@gmail.com>
Date:   Fri Feb 23 20:45:01 2018 +0100

    #785: Remove functional test

commit 5484576d6e3ef4a53d69860ef953bb48037e8a72
Merge: a36a8b4 f59aa93
Author: Vladimir Iakovlev <nvbn.rm@gmail.com>
Date:   Fri Feb 23 20:44:20 2018 +0100

    Merge branch 'master' of https://github.com/alexbarcelo/thefuck into alexbarcelo-master

commit f59aa931c3
Author: Alex Barcelo <alex.barcelo@gmail.com>
Date:   Fri Feb 16 23:43:43 2018 +0100

    rewritten match + fish output check for cd_* rules

commit 150ecee00f
Author: Alex Barcelo <alex.barcelo@gmail.com>
Date:   Fri Feb 16 23:43:19 2018 +0100

    Adding unittest for cd_correction (with extra fish test case, also for cd_mkdir)

commit e73dd3f6d1
Author: Alex Barcelo <alex.barcelo@gmail.com>
Date:   Fri Feb 16 22:48:22 2018 +0100

    adding functional test for cd_correction rule

commit d1dbbb57d9
Author: Alex Barcelo <alex@betarho.net>
Date:   Fri Feb 16 12:21:33 2018 +0100

    Include root (start with /) case
2018-02-23 20:45:36 +01:00
JunYoung Gwak
dd9554539f Added a rule to delete sudo for pacaur. (#787) 2018-02-22 22:14:02 +01:00
Omer Katz
b65e3a9aad Added hebrew the list of keyboard layouts (#778)
* Added hebrew the list of keyboard layouts.

Fixes #776.

* Added tests for hebrew layout.

* Fix test.

* Make lint happy.
2018-01-29 08:46:18 +01:00
Joseph Frazier
027b41da59
Add git_merge_unrelated rule for git merge --allow-unrelated-histories (#773)
From https://git-scm.com/docs/merge-options#merge-options---allow-unrelated-histories

> By default, `git merge` command refuses to merge histories that do not
share a common ancestor. This option can be used to override this safety
when merging histories of two projects that started their lives
independently.
2018-01-16 20:03:56 -05:00
David Hart
c205683a8d git_push: Handle branch names containing 'set-upstream' (#759)
This should fix https://github.com/nvbn/thefuck/issues/723 (IndexError when using bitbucket)
2018-01-06 17:44:03 -05:00
David Hart
7c858fadb3 #762: handle single quotes in git_branch_exists
* handle single quotes in git_branch_exists

* Fix line length

* Fix missing quotes from test
2018-01-05 19:25:08 -02:00
David Hart
797ca1c564 Offer git commit --amend after previous git commit (#764) 2018-01-05 16:24:43 -05:00
David Hart
7b10a86267 Add rule for ADB unknown commands (#765) 2018-01-05 16:20:03 -05:00
David Hart
b62bb90a0d git_push: Escape single quote in branch names (#760)
Parameterize test output fixture.

Check for 'push' in command.script_parts than anywhere in command.script.
2018-01-04 11:40:01 -05:00
Joseph Frazier
a696461cd3 Add apt_upgrade rule (#761)
* apt_list_upgradable: Prepend sudo to suggestion if used in command

* Add apt_upgrade rule

This suggests `apt upgrade` after `apt list --upgradable` if there are
packages to upgrade. It pairs well with the `apt_list_upgradable` rule,
which suggests `apt list --upgradable` after `apt update` if there are
packages to upgrade.

* Add apt_upgrade rule to README
2018-01-03 19:01:09 +01:00
David Hart
f700b23f57 Add git merge rule (#755)
This fixes https://github.com/nvbn/thefuck/issues/629
2018-01-02 11:47:48 -05:00
David Hart
57fb6e079a git_push: Make option handling more robust (#751)
See https://github.com/nvbn/thefuck/issues/740#issuecomment-354466567
2018-01-01 19:45:46 -05:00
David Hart
83cf97dc26 Suggest git checkout -b (#754)
This fixes https://github.com/nvbn/thefuck/issues/632

This uses `script_parts` instead of `script.startswith`
to let it work even if there's extra spaces in the command, e.g.

    git  checkout unknown
2018-01-01 18:30:33 -05:00
Joseph Frazier
4ea02a3153
git_push: Don't add duplicate remote/branch name (#745)
This fixes https://github.com/nvbn/thefuck/issues/740
2017-12-27 07:54:52 -05:00
Joseph Frazier
d582159670 Add apt_list_upgradable rule (#732)
This helps you run `apt list --upgradable` after `apt update`,
as it suggests.
2017-11-16 20:19:44 +01:00
Joseph Frazier
10ac1a3b38
#728: Add heroku_multiple_apps rule (#729)
Closes https://github.com/nvbn/thefuck/issues/728
2017-11-09 18:42:23 -05:00
Joseph Frazier
8fb5ddefb6 git_flag_after_filename: Handle new error message
See 2a5aa826ee
2017-11-01 09:42:52 -04:00
Pablo Santiago Blum de Aguiar
75d2c43997 #702: fix minor issues with php_s rule
Unfortunately, I didn't catch these issues while reviewing #702.

After looking more closely at `php` options, `-S` requires additional
arguments (<address>:<port>) and `-s` may produce output if used that
way. So, matching ` -s ` seems to be better.

Also, `@for_app('php')` already asserts the presence of `php ` in the
command script. Matching `php -s` prevents the rule from fixing commands
like `php -t public -s 0.0.0.0:8080`.
2017-10-15 17:18:21 -02:00
Stef Pletinck
64d6835e15 #652: Add new git_push_different_branch_names rule
Fix #652

* Basic fix for #652
* Finishing work
* Added readme line
* Added test
* My test was stupid...
* Removed redundant lines
* That space...
2017-10-15 13:30:29 -02:00
Vladimir Iakovlev
bab5de236f #710: Fix tests 2017-10-15 16:39:40 +02:00
Vladimir Iakovlev
985b2d9ec9 #N/A: Add brew_cask_dependency rule 2017-10-15 16:11:08 +02:00
Vladimir Iakovlev
a906a751c8 #N/A: Add prove_recursively rule 2017-10-15 15:51:09 +02:00
Stef Pletinck
e658f35bd9 quick fix for #655 (#702)
* quick fix for #655

* Enabled by default and fix

* Test

* Added readme line

* This is unnecessary
2017-10-10 19:24:38 +02:00