Skip to content

Felarn/frontend-project-46

Repository files navigation

Tests

my-tests - My tests

Actions Status - Hexlet tests and linter status.

Maintainability - Maintainability от Codeclimate.

Test Coverage - Test coverage от Codeclimate.

Description

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 ->

Installation

  1. clone repository
  2. run command "make install"
git clone [email protected]:Felarn/frontend-project-46.git
cd frontend-project-46/
make install

asciicast

Usage

$ 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:
stylish (default option)
Structured output. Sample ->
plain
Report in plain text. List includes only changed, added or deleted keys, unchanged keys are skipped. Sample->
json
Output in json format. Sample ->
-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';

Demo

stylish

asciicast

plain

asciicast

JSON

asciicast

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published