1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-03-13 22:28:33 +00:00

Fix README and add a test so it won't happen again

This commit is contained in:
mcarton 2015-08-17 16:05:23 +02:00
parent 9b30ae0424
commit bc6b107066
2 changed files with 22 additions and 2 deletions

View File

@ -163,7 +163,7 @@ using the matched rule and runs it. Rules enabled by default are as follows:
* `grep_recursive` – adds `-r` when you trying to `grep` directory;
* `gulp_not_task` – fixes misspelled gulp tasks;
* `has_exists_script` – prepends `./` when script/binary exists;
* `heroku_no_command` – fixes wrong `heroku` commands like `heroku log`;
* `heroku_not_command` – fixes wrong `heroku` commands like `heroku log`;
* `history` – tries to replace command with most similar command from history;
* `java` – removes `.java` extension when running Java programs;
* `javac` – appends missing `.java` when compiling Java files;
@ -185,7 +185,7 @@ using the matched rule and runs it. Rules enabled by default are as follows:
* `sl_ls` – changes `sl` to `ls`;
* `ssh_known_hosts` – removes host from `known_hosts` on warning;
* `sudo` – prepends `sudo` to previous command if it failed because of permissions;
* `switch_layout` – switches command from your local layout to en;
* `switch_lang` – switches command from your local layout to en;
* `systemctl` – correctly orders parameters of confusing `systemctl`;
* `test.py` – runs `py.test` instead of `test.py`;
* `tsuru_login` – runs `tsuru login` if not authenticated or session expired;
@ -200,6 +200,7 @@ Enabled by default only on specific platforms:
* `brew_unknown_command` – fixes wrong brew commands, for example `brew docto/brew doctor`;
* `brew_upgrade` – appends `--all` to `brew upgrade` as per Homebrew's new behaviour;
* `pacman` – installs app with `pacman` if it is not installed (uses `yaourt` if available).
* `pacman_not_found` – fix package name with `pacman` or `yaourt`;
Bundled, but not enabled by default:

19
tests/test_readme.py Normal file
View File

@ -0,0 +1,19 @@
from pathlib import Path
def test_readme():
with open('README.md') as f:
readme = f.read()
bundled = Path(__file__).parent.parent \
.joinpath('thefuck') \
.joinpath('rules') \
.glob('*.py')
for rule in bundled:
if rule.stem != '__init__' and rule.stem not in readme:
raise Exception('Missing rule "{}" in README.md'.format(rule.stem))
if __name__ == '__main__':
test_readme()