From bc6b107066d3f1e60b4cfcaa8cf6399e98cf1b1c Mon Sep 17 00:00:00 2001 From: mcarton Date: Mon, 17 Aug 2015 16:05:23 +0200 Subject: [PATCH] Fix README and add a test so it won't happen again --- README.md | 5 +++-- tests/test_readme.py | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 tests/test_readme.py diff --git a/README.md b/README.md index e67bff9d..58b4c584 100644 --- a/README.md +++ b/README.md @@ -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: diff --git a/tests/test_readme.py b/tests/test_readme.py new file mode 100644 index 00000000..2cd5508b --- /dev/null +++ b/tests/test_readme.py @@ -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()