- Hexlet tests and linter status.
- Maintainability от Codeclimate.
- Test coverage от Codeclimate.
This is the second training project from Hexlet - "Difference calculator" - the program to determine difference between two data structures.
Input data is read from files with extensions .json, .yaml или .yml. Output is made to console with option to colorize output. Multiple output formats are supported: plain text, structured with indentations and json. More details in section Usage ->
- clone repository
- run command "make install"
git clone [email protected]:Felarn/frontend-project-46.git
cd frontend-project-46/
make install
$ gendiff -h
Usage: gendiff [options] <filepath1> <filepath2>
Compares two configuration files and shows a difference.
Options:
-V, --version output the version number
-c --colorize colorize terminal output
-f --format <type> output format
-h, --help display help for command
When called from console, inputs are:
- -f --format
- Report format. Possible values:
- -c --colorize
-
Flag to colorize of console output depending on changes made to key (turned off by default)
Color code:
stylish plain json removal $${\color{Red}Red}$$ $${\color{Red}Red}$$ $${\color{White}White}$$ change $${\color{yellow}Yellow}$$ $${\color{White}White}$$ addition $${\color{lightgreen}Green}$$ $${\color{lightgreen}Green}$$ unchanged $${\color{White}White}$$ - - path1 и path2
- Path to files to compare. Both absolute and relative paths are acceptable. Supported file extensions .json, .yaml и .yml
Function call arguments are:
gendiff(path1, path2 [, formatStyle = 'stylish'[, colorize = false]])
where:
- path1 и path2 - strings containing file paths;
- formatStyle - output format - string with possible arguments: 'stylish', 'plain' и 'json';