Open neelkarma opened 3 years ago
That would be an nice improvement.
has this been resolved? If not, I wanted to try tackling this. Any help would be appreciated.
Go for it, @TarunRKaushik! 🚀
hey @scorphus, I was having some trouble running the app locally(for debugging purposes), when I try to run main.py, I get this:
Traceback (most recent call last):
File "G:\open_source\thefuck\thefuck\entrypoints\main.py", line 2, in <module>
from ..system import init_output
ImportError: attempted relative import with no known parent package
Should I be changing the working directory? Or am I missing something here?
Probably the best way to run it is by calling thefuck
from the terminal. e.g. thefuck PINGG
or thefuck "git brnch"
.
Hi university capstone project -- our group is trying our hand at this issue, too. Is there any good starting point as to adding the necessary functionality/fix for this? My initial assumption would be somewhere in conf or correcter.py. But I noticed that difflib has been mentioned here, too.
One point of interest would be utils.get_all_executables()
:
https://github.com/nvbn/thefuck/blob/d8ddf5a2be9d52ec4bc8c11e79fcc7b3c390b669/thefuck/utils.py#L112-L133
as it is used in the no_command
rule:
https://github.com/nvbn/thefuck/blob/d8ddf5a2be9d52ec4bc8c11e79fcc7b3c390b669/thefuck/rules/no_command.py#L1-L42
I gave this issue a bit more thought. Turning executable names to lower case might work for case-insensitive file systems, but it may be quite tricky to ensure that all executables lie on such file system and not elsewhere. Even trickier to not convert to lower case those that lie on case-sensitive file systems. So it looks like this issue could hardly be effectively solved this way.
Another possible solution could be a new no_command_i
rule that would try to find matches case-insensitively. It could borrow/adapt the ideas discussed in this SO thread: https://stackoverflow.com/questions/11384714/ignore-case-with-difflib-get-close-matches
There are a few more caveats to it, but they can be explored once the new rule gets some initial shape.
As to difflib
, this BPO has some interesting discussions: https://bugs.python.org/issue39891. It also has a conclusion. So, maybe a new package? Check existing ones in PyPI: https://pypi.org/search/?q=difflib
I see, thank you for the insight. One of those threads eventually led to something about get-close_matches_ignorecase()
The output of
thefuck --version
(something likeThe Fuck 3.1 using Python 3.5.0 and Bash 4.4.12(1)-release
):Your system (Debian 7, ArchLinux, Windows, etc.):
How to reproduce the bug:
The output of The Fuck with
THEFUCK_DEBUG=true
exported (typically executeexport THEFUCK_DEBUG=true
in your shell before The Fuck):If the bug only appears with a specific application, the output of that application and its version:
Anything else you think is relevant: