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

1606 Commits

Author SHA1 Message Date
Dave Storey
58f61d8090
#1184: Add devcontainer for easy Python development
* adding devcontainer and new rule for main-master

* update devcontainer work

* cleaning up devcontainer.json

* fixed line ending

* move to VARIANT 3

* Update .devcontainer/devcontainer.json

* Update .devcontainer/devcontainer.json

* Update .devcontainer/devcontainer.json

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
2021-07-19 22:47:19 +02:00
Pablo Santiago Blum de Aguiar
0668822abb #1215: Remove redirection to stderr with the ^ character
Redirection to standard error with the `^` character is disabled by
default since Fish Shell version 3.3[1].

Fix #1214

[1]: https://github.com/fish-shell/fish-shell/blob/master/CHANGELOG.rst#deprecations-and-removed-features-1
2021-07-18 15:10:48 +02:00
Pablo Santiago Blum de Aguiar
711feb4df5 #1184: Improve + fix git_main_master rule 2021-07-09 16:13:25 +02:00
Dave Storey
70a42b54ab #1184: Add new rule for main / master Git branches 2021-04-06 14:50:43 +01:00
Pablo Santiago Blum de Aguiar
11b70526f7 #1131: Improve git_commit_add rule
Add more capabilities to the rule, remove its priority and fix tests
2021-07-08 21:43:35 +02:00
Sergei Haller
55922e4dbe #1131: Add rule for Git commit with no added files 2020-09-08 11:47:05 +02:00
Pablo Santiago Blum de Aguiar
799f4127ca #942: Improve git_branch_0flag rule - with a new name 2021-07-13 15:36:11 +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
M. H. Kwon
13fda64d6e
#1109: Fix a typo on a comment
on -> one
2021-07-06 16:58:44 +02:00
Abraham Chan
6111523034
#1210: Add rule 'rails_migrations_pending'
* Add rule 'rails_migrations_pending'

* Update thefuck/rules/rails_migrations_pending.py

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>

* Add initial command to corrected command

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
2021-07-06 12:52:54 +02:00
ProfessorTom
24576b30b2
#942: Add new git_branch_0v_to_dash_v 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
2021-07-01 23:07:38 +02:00
T.J. Kolberg
373f445e9b
#1150: Update the name of macOS on README
* Update README.md

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
2021-07-01 11:47:12 +02:00
Divy Jain
54253027e3
#1123: Update composer_not_command rule (#1135)
Fix #1123
2021-06-30 23:10:06 +02:00
theslimshaney
9201ce79cf #1039: Remove all leading $ not just one 2021-06-30 22:46:20 +02:00
Romain Heller
7f97818663
#455: [README] Add uninstall instructions (#1171)
* ~[Doc] Add Uninstall instructions

As we need the package and to modify the shell config, users could have a pain in the ass when it comes to retire *The Fuck* from the system.

* Update README.md

* Update README.md

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
2021-06-30 14:20:48 +02:00
Abraham Chan
2f4adcf3cb
#N/A: Fix yield_fixture deprecation (#1211) 2021-06-29 21:26:13 +02:00
Elisha Hollander
06e14afd17
#N/A: Fix grammar and spelling errors (#1193)
* Fix grammar and spelling errors

* Update README.md

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
2021-06-29 21:25:01 +02:00
Utkarsh Agarwal
3651b0fa0c
#1164: Optimize GIFs with ImgBot
*Total -- 1,239.63kb -> 1,088.54kb (12.19%)

/example_instant_mode.gif -- 535.22kb -> 457.41kb (14.54%)
/example.gif -- 704.41kb -> 631.13kb (10.4%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>

Co-authored-by: ImgBotApp <ImgBotHelp@gmail.com>
2021-06-23 12:19:47 +02:00
Felix Yan
d723bb71b7 Avoid using pkg_resources
pkg_resources is expensive to load, and it's an external module provided
by the setuptools project.

Let's use importlib.metadata from Python 3.8+'s stdlib when available, which
is much faster. This also erases setuptools from thefuck's runtime
dependency.

Simple benchmark data for `thefuck --version`:

Before: 0.602s
After: 0.169s
2021-06-21 17:06:02 +02:00
Hamid Nazari
b2e1886de8 Fix git_hook_bypass priority (#1207) 2021-06-21 16:32:35 +02:00
Vladimir Iakovlev
0949d2e770 Bump to 3.31 2021-06-09 21:50:44 +02:00
Vladimir Iakovlev
e343c577cd
NA: Fix possible changes in files outside of working directory (#1206) 2021-06-08 22:04:51 +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
Pablo Santiago Blum de Aguiar
1a595f1ba2 #N/A: Force decorator<5 for Python <= 2.7
For some reason, the index used by GH Actions is not considering the
requesting Python version to decide which package version to deliver.
This is unnecessary for the official index and will be removed once we
drop support to Python 2.
2021-04-18 15:48:39 +02:00
godofhyperdeath
875d3f11cb
#N/A: Update license year to 2020-2021 (#1088)
Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
2021-04-17 00:24:30 +02:00
Sid Shardanand
4c7479b3ad
#N/A: Add cd_cs rule (#1167)
* 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>
2021-03-22 20:55:45 +01:00
Divy Jain
5b612add74
#1154: Fix badges in README (#1175) 2021-03-13 14:24:53 +01:00
Pablo Santiago Blum de Aguiar
b9dd54c768 #1174: Fix anchor references 2021-03-13 12:50:09 +01:00
Bhavishya Pandit
7af9f41d93
#N/A: Add a Contents section to README (#1174)
* Update README.md

* Update README.md

* Update README.md

* Update README.md

* Update README.md

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
2021-03-13 00:58:10 +01:00
Pablo Santiago Blum de Aguiar
c2cc95db88 #1117: Mock Popen in go_unknown_command test
Instead of ignoring it whenever `go` is unavailable
2021-02-22 22:54:45 +01:00
Georgios Kontosis
0e34c2343e
#/N/A: Extend pyenv rule to include goenv, nodenv and rbenv (#1100)
Co-authored-by: Pablo Santiago Blum de Aguiar <scorphus@gmail.com>
Co-authored-by: Divy Jain <dkj@somaiya.edu>
2021-02-11 12:48:20 +01:00
Connor Martin
fd90e69ceb
#N/A: Add conda rule (#1138)
* 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>
2021-02-08 13:04:59 +01:00
Divy Jain
0c58317932
#N/A: Migrate CI pipeline to Github Actions (#1154)
Co-authored-by: Pablo Santiago Blum de Aguiar <scorphus@gmail.com>
2021-01-21 14:34:01 +01:00
Divy Jain
62dddd5821
#1149: Add python_module_error rule (#1151) 2021-01-19 22:37:05 +01:00
Divy Jain
40dd65963d
#1141: Fix crash on empty history (#1145) 2020-11-18 10:43:11 +01:00
Kartik Soneji
836f6eeac5
Skip test instead of failing if go executable is not found. (#1117) 2020-11-03 18:30:03 +01:00
Kartik Soneji
b4c75eebe6
Fix pytest warnings (#1116)
* Add custom pytest mark.

* Fix typo usefixture -> usefixtures.
2020-11-03 18:29:28 +01:00
Pablo Aguiar
22efa8f70e
#1113: Do not load excluded rules (#1125) 2020-11-03 18:27:09 +01:00
Pablo Aguiar
9d3bcad229
#1113: Ignore a rule that fails to load (#1124) 2020-11-03 18:26:13 +01:00
Divya Jain
c196e2901c
#509: Fixed correction on windows machine running other shells (#1091)
* Replaced print with sys.stdout.write

* Fixed tests

* Normalized line endings
2020-07-16 23:56:58 +02:00
Aditi Gupta
ca46956e20
#1066 - Fix rule for brew cask (#1111)
* #1066: Add cask to list of fallback commands

* #1066: Fix homebrew paths
2020-07-16 23:34:41 +02:00
Nyanotech
639e9bda7a
Add rule to remove a doubled-up "git clone" in a git clone command. (#1106)
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.
2020-07-16 23:34:22 +02:00
Divya Jain
39753a004e
#1096: Rule: Bypass failed git hook (#1097)
* naive implementation

* better implementation

* remove redundant enabled_by_default

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>

* add README entry

* add tests

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
2020-07-16 23:32:29 +02:00
Divya Jain
365db1ee41
#N/A: Refactor for better readability (#1094)
* #N/A: Refactor for better readability

* Change typename for test tuple

* Rename variable
2020-06-14 16:20:40 +02:00
Divya Jain
81b39defe4
#N/A: Fix formatting (#1092)
* Fixed corrector.py format string

* Fixed types.py format string

* Fixed tests/rules/test_fix_file.py formatting

* Removed trailing whitespace

* Fixed UnicodeEncodeError in python 2.7
2020-06-11 00:21:45 +02:00
Connor Martin
f82176802e
add git-lfs support (#1056)
* 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
2020-06-11 00:20:37 +02:00
Pablo Aguiar
6975d30818
#960: Improve pacman_invalid_option rule (#1072)
The rule now matches all possible lower case options and only those, not
failing for those that cannot be fixed.
2020-04-06 21:46:40 +02:00
DragonGhost7
3c542a5b8c
Added pacman invalid option rule (#960)
* Added pacman invalid option rule

* Added test

* flake8 fixes

* Test changes

* Test fix

* Typo - again

* Travis test fix

* More Travis

* Even more travis

* I hope im right here

* Update README.md

Co-Authored-By: Pablo Aguiar <scorphus@gmail.com>

* Update thefuck/rules/pacman_invalid_option.py

Co-Authored-By: Pablo Aguiar <scorphus@gmail.com>

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
2020-03-28 23:15:20 +01:00
Vladimir Iakovlev
d3a05426de Bump to 3.30 2020-03-19 18:21:12 +01:00
Caplinja
88db57b4b1 #N/A: Add a new rule to create directory on cp or mv 2020-03-01 13:04:53 -06:00