1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-05 18:31:10 +01:00
Commit Graph

45 Commits

Author SHA1 Message Date
Hugo van Kemenade
5f562a185c Drop the dot https://twitter.com/pytestdotorg/status/753767547866972160 2023-07-09 13:03:27 +02:00
Ryan Delaney
fe1942866b
#1133: Match commands with path prefixes in @for_app decorations
* 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.
2021-07-07 23:05:55 +02:00
Abraham Chan
2f4adcf3cb
#N/A: Fix yield_fixture deprecation (#1211) 2021-06-29 21:26:13 +02:00
Stuart Leeks
6da0bc557f
Add excluded_search_path_prefixes setting (#1165)
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>
2021-04-21 19:43:21 +02:00
Vladimir Iakovlev
60073bea78
N/A: Remove deprecated python 3.4 support + fix tests in 2.7 (#1025)
* N/A: Remove deprecated python 3.4 support

More details - https://www.python.org/downloads/release/python-3410/

* N/A: Remove Python 3.4 from appveyor config

* N/A: Fix UnicodeDecodeError with Python 2.7 and newer versions of py.test
2019-12-16 21:55:19 +01:00
Pablo Aguiar
78ef9eec88 #902: Use os.pathsep to split PATH env var (#917)
Fix #902
2019-05-21 20:47:47 +02:00
Pablo Aguiar
25142f81f8 Some improvements (#846)
* #833: do not require sudo on TravisCI

* #N/A: Add Python dev releases to TravisCI pipeline

Inspired by Brett Cannon's advise [1].

    1: https://snarky.ca/how-to-use-your-project-travis-to-help-test-python-itself/

* #837: try and kill proc and its children

* #N/A: show shell information on `thefuck --version`

* #N/A: omit default arguments to get_close_matches

* #842: add settings var to control number of close matches

* #N/A: remove `n` from the list of `get_closest`'s args
2018-10-08 22:32:30 +02:00
Vladimir Iakovlev
1f8f3dd967 #707: Update tests 2017-10-10 08:31:45 +02:00
Vladimir Iakovlev
d9fd5e8a6b #707: Reimplement cache 2017-10-10 08:30:26 +02:00
Vladimir Iakovlev
4625d8503d #682: Unify work with output in classic and instant mode 2017-08-31 17:58:56 +02:00
Vladimir Iakovlev
754bb3e21f #N/A: Reset environment variables in tests 2017-08-03 12:18:05 +02:00
Joseph Frazier
22b005cebb Fix flake8 errors: E731 do not assign a lambda expression, use a def 2016-10-06 13:30:05 -04:00
Vladimir Iakovlev
46cb87615e #N/A: Remove old-style rules support 2016-08-14 14:37:32 +03:00
Pablo Santiago Blum de Aguiar
e5f8e9c0de #N/A: Assert deprecated warnings are raised 2016-05-15 17:04:09 -03:00
Pablo Santiago Blum de Aguiar
561eb12c08 #504: UTF8-decode bin names if on Python 2
Fix #504
2016-05-11 13:31:57 -03:00
Pablo Santiago Blum de Aguiar
ed38fedf26 #504: Mock get_all_executables internals instead 2016-05-11 02:04:05 -03:00
nvbn
251b69b5a0 #475: Try to use already used executable in no_command 2016-03-13 15:10:37 +03:00
nvbn
fe07fcaa62 #441: Remove shells methods wrappers 2016-01-29 13:09:40 +03:00
nvbn
60e19a054a #N/A: Replace PY3 checks with PY2 checks 2016-01-22 17:02:08 +03:00
nvbn
df4d2cc88d ⚠️ Remove settings param from rules match, get_new_command and side_effect 2015-09-07 13:00:29 +03:00
nvbn
382eb8b86c Fix tests 2015-09-07 12:12:16 +03:00
nvbn
dd0667ea8f #356 Ignore thefuck entry points 2015-09-06 13:37:48 +03:00
nvbn
9a02e821cd Fix python 2 support 2015-09-02 11:54:58 +03:00
nvbn
4129ff2717 #353 Cache aliases in a temporary file 2015-09-02 11:10:03 +03:00
nvbn
9103c1ffd5 Add is_app/for_app helpers 2015-08-27 16:08:29 +03:00
nvbn
b21c9ebb43 Move all app/os specific utils to specific package 2015-08-25 14:09:47 +03:00
mcarton
88831c424f Fix the @wrap_settings annotation
It seems much more useful if it only adds settings that are not already
set.
2015-08-17 16:07:24 +02:00
nvbn
4bc1cc7849 #298 Add support of list results in sudo_support 2015-07-29 15:40:21 +03:00
Pablo Santiago Blum de Aguiar
4e854a575e Move get_all_matched_commands over to utils 2015-07-27 22:29:02 -03:00
nvbn
469c5a60b0 #N/A Add replace_argument helper 2015-07-24 00:39:56 +03:00
mcarton
903abff77e Support hub as well as git in @git_support 2015-07-21 15:06:04 +02:00
nvbn
dee018e792 #N/A Move get_all_executables (formerly get_all_callables) to utils 2015-07-20 21:04:49 +03:00
nvbn
4f5659caad #87 Add ability to fix branch names in git_checkout rule 2015-07-20 19:25:29 +03:00
mcarton
5d0912fee8 Unquote over-quoted commands in @git_support
This allows writing rules more easily (eg. the git_branch_list rule
tests for `command.script.split() == 'git branch list'.split()`) and
looks nicer when `require_confirmation` is set.
2015-07-17 14:07:17 +02:00
mcarton
b3e09d68df Start support for git aliases 2015-07-16 20:23:31 +02:00
nvbn
7ebc8a38af #N/A Add history rule 2015-07-10 17:58:41 +03:00
nvbn
f40b63f44b #N/A Add ability to disable memoization in tests 2015-07-10 17:06:05 +03:00
nvbn
c0eae8b85c #N/A Add get_closest utility function 2015-07-08 21:30:24 +03:00
nvbn
190e47ecdb #215 Use memoize decorator for caching 2015-05-22 17:07:01 +03:00
nvbn
dd1861955c Refine tests 2015-05-02 04:29:55 +02:00
nvbn
b7cb407637 Add useful constructors for Rule and Command for tests 2015-04-25 02:35:26 +02:00
nvbn
d3d1f99232 Move special data types to types 2015-04-22 23:04:22 +02:00
nvbn
0553d57ec1 Don't mess with inheritance for filling settings 2015-04-22 22:29:23 +02:00
nvbn
69a9516477 Add ability to change settings via environment variables 2015-04-22 20:18:53 +02:00
nvbn
e7b78205f4 Add transparent sudo support for rules where it required 2015-04-22 16:45:38 +02:00