* Add git clone missing rule
* Clean up tests and improve matching
* Make rules behave correctly?
* Improve tests and redo matcher
* Remove unnecessary tests
* Improvements as per code review
* Remove dead tests
* Improve match function for git clone missing
* Improve tests
* Fix more tests
* Fix failing test
* Add Macos's /bin/sh command output to match
* Add output for lines uncovered by tests
Co-authored-by: Pablo Santiago Blum de Aguiar <scorphus@gmail.com>
* fix: Update output for brew_install test: fixed
* chore: fixing flake8 styles
* feat: show more suggestions
* test: new functions added and multi suggestions
* refactor: rename to _get_suggestions
* added updatedb(mlocate) to sudo rules
* Add test
Co-authored-by: phk <phk@terminal21.de>
Co-authored-by: Pablo Santiago Blum de Aguiar <scorphus@gmail.com>
Using the `force_command` argument will run into issues as the
`_get_raw_command` method simply returns the value of `force_command`
(which is a string) while it should actually return a list.
Fix#1240
* Resolve paths before checking app identity
Commands entered with a path do not match is_app. I encountered this
when working with a test for the rm_dir rule. This rule did not use the
@for_app decorator, but when I migrated it, the test for "./bin/hdfs.."
failed because 'hdfs' was recognized as a command, while "./bin/hdfs"
was not.
This commit addresses the false negative by resolving path names in the
command, via os.path.basename.
* Remove paths from for_app invocations in rules
I presume that the `./` in `./gradlew` was used here because thefuck
would not find an app match on just `gradlew`, and thus no fucks would
be given on the most common and idiomatic way of invoking gradlew.
After 8faf9b1, thefuck does not distinguish between commands with
paths and those without. Therefore, the tests for this rule are now
broken because thefuck strips paths from the _user_'s command, but not
from the for_app decoration.
This commit addresses that problem by changing the for_app decoration to
this rule.
* fix fuckup `branch 0v` by...
...deleting branch `0v` and running `git branch -v` as the user intended
* use quotes consistently
* provide new solution implementation based on feedback on PR
* rename files to more accurately reflect their more generic contents
* update import statement to match new file name
* update command name in README.md
* separate out matching tests so the pattern is clear for those who add matches in the future
Improves performance in WSL
Fix#1036
* Add excluded_search_path_prefixes setting
Allows filtering the paths used to search for commands
Can be useful to filter out /mnt/ in WSL for performance
* Add test for excluded_search_path_prefixes
* Apply suggestions from code review
Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
* adding in files for the cd-cs feature
* Updated thefuck/rules/cd_cs.py comments to be more verbose
Thanks Scorphus!
Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
* Updating the rules file to exclude the \xe2 character
This character(–) has lead to the commit failing some of the tests.
I am removing it from the code and we should see the tests pass now.
* Setting the encoding in thefuck/rules/cd_cs.py
Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
Co-authored-by: SID SHARDANAND <sshardan@deakin.edu.au>
Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
* add conda rules
* revert
* add conda
* add to readme and flake
* consistency with quotes and use for_app
* Update thefuck/rules/conda_mistype.py
Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
Some git hosts will copy the entire clone command, while others just
copy the url, so typing "git clone ", then pasting a git url that
already has a "git clone " on the front is a somewhat common issue.
* add mistyping support for git lfs
* add the rule
* fix flake8
* flake8
* add to readme
* use fixtures and regex
* get rid of additional matched strings