Create cat_dir rule for replacing cat with ls (#823)

* Create `cat_dir` rule for replacing `cat` with `ls` when you try to run `cat` on a directory.

* Changed to string methods in response to feedback.

Added a test to make sure lines like 'cat cat' don't become 'ls ls'.

Added trailing '\n's to test cases.
This commit is contained in:
Scott Colby
2018-07-09 15:51:42 -07:00
committed by Vladimir Iakovlev
parent 142ef6e66c
commit fe0785bc42
3 changed files with 40 additions and 0 deletions
+1
View File
@@ -177,6 +177,7 @@ following rules are enabled by default:
* `aws_cli` – fixes misspelled commands like `aws dynamdb scan`;
* `cargo` – runs `cargo build` instead of `cargo`;
* `cargo_no_command` – fixes wrongs commands like `cargo buid`;
* `cat_dir` – replaces `cat` with `ls` when you try to `cat` a directory
* `cd_correction` – spellchecks and correct failed cd commands;
* `cd_mkdir` – creates directories before cd'ing into them;
* `cd_parent` – changes `cd..` to `cd ..`;