| OLD | NEW |
| (Empty) | |
| 1 # layout-test-tidy |
| 2 |
| 3 This tool, a Node.js CLI utility, performs a set of clean-up tasks for layout |
| 4 test files in LayoutTests/webaudio. (Potentially it can be applied to any kind |
| 5 of layout test files in HTML or JS format.) |
| 6 |
| 7 The clean-up tasks includes: |
| 8 |
| 9 - Sanitize missing or incorrect HTML elements: reordering |script| elements |
| 10 or adding missing |title| element. |
| 11 - Apply [html-tidy](http://www.html-tidy.org/). |
| 12 - Apply [clang-format](https://clang.llvm.org/docs/ClangFormat.html). |
| 13 - Perform RegExp substitution based on predefined dictionary. (e.g. |var| to |
| 14 |let|, or redundant empty lines in markup.) |
| 15 |
| 16 For every step of clean-up processing, the tool collects warning, diagnostics |
| 17 or notes and print out the logs at the end of the processing. |
| 18 |
| 19 |
| 20 ## Installation |
| 21 |
| 22 ``` |
| 23 cd ${WHERE_PACKAGE_JSON_IS} npm install |
| 24 ``` |
| 25 |
| 26 The warning from html-tidy package can be safely ignored. |
| 27 |
| 28 |
| 29 ## Usage |
| 30 |
| 31 ``` |
| 32 node layout-test-tidy ${TARGET_PATH} |
| 33 ``` |
| 34 |
| 35 When the target path is a directory, it scans all the files in the subdirectory. |
| 36 Specifying a single file is also valid operation. |
| 37 |
| 38 ``` |
| 39 node layout-test-tidy ${TARGET_PATH} -v > result.txt |
| 40 ``` |
| 41 |
| 42 By default, the result will be written to stdout, so you can pipe the result to |
| 43 a file as shown above. `-v` or `--verbose` option is useful when collecting |
| 44 warnings and notes generated by the tool. |
| 45 |
| 46 ``` |
| 47 node layout-test-tidy ${TARGET_PATH} -i |
| 48 ``` |
| 49 |
| 50 For in-place processing, use `-i` or `--inplace` switch. |
| 51 |
| 52 ``` |
| 53 node layout-test-tidy ${CHROME_SRC}/third_party/WebKit/LayoutTests/webaudio |
| 54 ``` |
| 55 |
| 56 - If there is a file to be skipped, simply create `skip-tidy` file and add |
| 57 absolute file paths of files to be skipped. |
| OLD | NEW |