All Projects → aleandros → tdiff

aleandros / tdiff

Licence: MIT license
CLI tool for comparing tree like structures

Programming Languages

crystal
512 projects

Projects that are alternatives of or similar to tdiff

crystalizer
(De)serialize any Crystal object - out of the box. Supports JSON, YAML and Byte format.
Stars: ✭ 32 (+60%)
Mutual labels:  yaml, crystal-lang
crystal-validator
💎 Data validation module for Crystal lang
Stars: ✭ 23 (+15%)
Mutual labels:  crystal-lang
fleet2kubes
Automate Kubernetes object conversion from CoreOS Fleet/systemd units
Stars: ✭ 12 (-40%)
Mutual labels:  yaml
theconf
Python Package for Managing Configurations
Stars: ✭ 35 (+75%)
Mutual labels:  yaml
Home-Assistant-Config
🏠 My huizebruin Home Assistant configuration, Be sure to 🌟 this repository for updates! huizebruin
Stars: ✭ 29 (+45%)
Mutual labels:  yaml
gitlab-configuration-as-code
Manage GitLab configuration as code to make GitLab easily managable, traceable and reproducible.
Stars: ✭ 31 (+55%)
Mutual labels:  yaml
ezorm
schema first orm for Go
Stars: ✭ 46 (+130%)
Mutual labels:  yaml
scout
Reading and writing in JSON, Plist, YAML and XML data made simple when the data format is not known at build time. Swift library and command-line tool.
Stars: ✭ 110 (+450%)
Mutual labels:  yaml
aquaplot
AquaPlot is a data visualization library for crystal-lang (https://crystal-lang.org/). Currently in very early development and the API is not at all stable.
Stars: ✭ 31 (+55%)
Mutual labels:  crystal-lang
webviz-config
Make Dash applications from a user-friendly config file 📖 🐍
Stars: ✭ 46 (+130%)
Mutual labels:  yaml
qaz
qaz—A CLI tool for Templating & Managing stacks in AWS Cloudformation
Stars: ✭ 89 (+345%)
Mutual labels:  yaml
fayrant-lang
Simple, interpreted, dynamically-typed programming language
Stars: ✭ 30 (+50%)
Mutual labels:  crystal-lang
fluence
WYSIWYG wiki powered by Crystal, markdown, and Git
Stars: ✭ 44 (+120%)
Mutual labels:  crystal-lang
niet
Parse/Read yaml or json files directly in your shell (sh, bash, ksh, ...)
Stars: ✭ 27 (+35%)
Mutual labels:  yaml
Clash
clash配置文件,基于ACL4SSR以及blackmatrix7修改
Stars: ✭ 53 (+165%)
Mutual labels:  yaml
front-matter
The most featured front matter (yaml, json, neon, toml) parser and dumper for PHP.
Stars: ✭ 23 (+15%)
Mutual labels:  yaml
schema-registry-gitops
Manage Confluent Schema Registry subjects through Infrastructure as code
Stars: ✭ 36 (+80%)
Mutual labels:  yaml
onechart
A generic Helm chart for your application deployments
Stars: ✭ 30 (+50%)
Mutual labels:  yaml
flutter plus
Develop applications in Flutter more quickly and easily. Customize Containers, Buttons, Texts and TextFields in a few lines. Navigate between Screens and open BottomSheets, Dialogs and Snackbars without context from any point.
Stars: ✭ 17 (-15%)
Mutual labels:  yaml
pyladies-courseware
Homework/task submit and review web app · based on React and Python aiohttp
Stars: ✭ 14 (-30%)
Mutual labels:  yaml

tdiff

Built with Crystal CI Latest release

A tool for comparing Tree like files, specifically JSON and YAML

Installation

Right now, simply go to the releases page and download the latest binary to your prefered directory in your path (like /usr/local/bin). This applies for both windows and linux

Using snap on Linux

If you have snap on your system, you can install it with

$ sudo snap install --beta tdiff # I hope to be able to consider it out of beta soon

Using Homebrew for OSX

$ brew tap aleandros/tdiff
$ brew install tdiff

Usage as a binary

Usage: tdiff [OPTION]... [SOURCE] <TARGET>

Identifies the differences between two tree-like file structures.

If <TARGET> is not present, input is assumed to come from STDIN. At this moment, only JSON and YAML are supported.

An exit status of 1 indicates an error in the program. An exit status of 127 indicates that there are differences between source and target. An exit status of 0 indicates no changes

Example output:

$ tdiff shard.yml shard.lock
- name: tdiff
* version: changed type from string to float
- authors: ["Edgar Cabrera <[email protected]>"]
- targets: {"tdiff" => {"main" => "main.cr"}}
- crystal: 0.34.0
- license: MIT
- development_dependencies: {"ameba" => {"github" => "crystal-ameba/ameba", "version" => "~> 0.12.0"}}
+ shards: {"ameba" => {"github" => "crystal-ameba/ameba", "version" => "0.12.1"}}

Usage as a shard

Add it to your application shards:

dependencies:
  tdiff:
    github: aleandros/tdiff

It just requires a couple of IO objects, containing the YAML or JSON data, and returns a list of Tdiff:Core::Result objects.

require "tdiff"

comparator = Tdiff.compare(File.open('target_1.yml'), File.open('target_2.yml'))
comparator.compare
comparator.results.each do |result|
  puts "#{result.path.join(".")}: #{result.difference.reason}"
end

If any of the inputs cannot be parsed, this method will raise a Tdiff::Exception error.

Development

This is a pretty standard crystal project. So install crystal with your prefered method.

First install dependencies with shards install.

Remember to run:

  • Tests with crystal spec
  • Format with crystal tool format
  • Ameba checks with bin/ameba

This will be checked by CI but still save yourself some time.

Documentation

You can find the documentation here

TODO

  • Compare file to STDIN
  • Compare yamls
  • Compare json
  • Presentation layer
  • Add auto-publish via github actions and installation instructions
  • Add portable binaries for OSX (or homebrew package)
  • Publish as snap package
  • Add portable binary for Windows
  • Fix file permission testing in CI
  • Allow Tdiff::Core to be used as a library
  • Support more array comparison algorithms
  • Allow presentation-level customizations at runtime

Contributing

  1. Fork it (https://github.com/aleandros/tdiff/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].