Skip to content

Commit

Permalink
add: readme and contribution guide
Browse files Browse the repository at this point in the history
Signed-off-by: shivamsouravjha <[email protected]>
  • Loading branch information
shivamsouravjha committed Aug 6, 2024
1 parent 58e0f68 commit 8b27f9e
Show file tree
Hide file tree
Showing 2 changed files with 210 additions and 0 deletions.
95 changes: 95 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Contributing to Keploy

Thank you for your interest in Keploy and for taking the time to contribute to this project. πŸ™Œ Keploy is a project by developers for developers and there are a lot of ways you can contribute.

If you don't know where to start contributing, ask us on our [Slack channel](https://join.slack.com/t/keploy/shared_invite/zt-2dno1yetd-Ec3el~tTwHYIHgGI0jPe7A).

## Code of conduct

Contributors are expected to adhere to the [Code of Conduct](CODE_OF_CONDUCT.md).

## Prerequisites for the contributors

Contributors should have knowledge of git, go, and markdown for most projects since the project work heavily depends on them.
We encourage Contributors to set up JsonDiff for local development and play around with the code and tests to get more comfortable with the project.

Sections

- <a name="contributing"> General Contribution Flow</a>
- <a name="#commit-signing">Developer Certificate of Origin</a>
- <a name="contributing-keploy">JsonDiff Contribution Flow</a>

# <a name="contributing">General Contribution Flow</a>

## <a name="commit-signing">Signing-off on Commits (Developer Certificate of Origin)</a>

To contribute to this project, you must agree to the Developer Certificate of
Origin (DCO) for each commit you make. The DCO is a simple statement that you,
as a contributor, have the legal right to make the contribution.

See the [DCO](https://developercertificate.org) file for the full text of what you must agree to
and how it works [here](https://github.com/probot/dco#how-it-works).
To signify that you agree to the DCO for contributions, you simply add a line to each of your
git commit messages:

```
Signed-off-by: Jane Smith <[email protected]>
```

In most cases, you can add this signoff to your commit automatically with the
`-s` or `--signoff` flag to `git commit`. You must use your real name and a reachable email
address (sorry, no pseudonyms or anonymous contributions). An example of signing off on a commit:

```
$ commit -s -m β€œmy commit message w/signoff”
```

To ensure all your commits are signed, you may choose to add this alias to your global `.gitconfig`:

_~/.gitconfig_

```
[alias]
amend = commit -s --amend
cm = commit -s -m
commit = commit -s
```

# How to contribute ?

We encourage contributions from the community.

**Create a [GitHub issue](https://github.com/keploy/jsondiff/issues) for any changes beyond typos and small fixes.**

We review GitHub issues and PRs on a regular schedule.

To ensure that each change is relevant and properly peer reviewed, please adhere to best practices for open-source contributions.
This means that if you are outside the Keploy organization, you must fork the repository and create PRs from branches on your own fork.
The README in GitHub's [first-contributions repo](https://github.com/firstcontributions/first-contributions) provides an example.

## ## How to set up the JsonDiff locally?

1. Fork the repository

<br/>

2. Clone the repository with the following command. Replace the <GITHUB_USERNAME> with your username

```sh
git clone https://github.com/<GITHUB_USERNAME>/jsondiff.git
```

<br/>

3. Go into the directory containing the project and edit the changes.

## <a name="contributing-keploy">JsonDiff Contribution Flow</a>

JsonDiff is written in `Go` (Golang) and leverages Go Modules. Relevant coding style guidelines are the [Go Code Review Comments](https://code.google.com/p/go-wiki/wiki/CodeReviewComments) and the _Formatting and style_ section of Peter Bourgon's [Go: Best
Practices for Production Environments](https://peter.bourgon.org/go-in-production/#formatting-and-style).

There are many ways in which you can contribute to JsonDiff.

# Contact

Feel free to join [slack](https://join.slack.com/t/keploy/shared_invite/zt-2dno1yetd-Ec3el~tTwHYIHgGI0jPe7A) to start a conversation with us.
115 changes: 115 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<p align="center">
<img align="center" src="https://docs.keploy.io/img/keploy-logo-dark.svg?s=200&v=4" height="40%" width="40%" alt="keploy logo"/>
</p>
<h3 align="center">
<b>
⚑️ API tests faster than unit tests, from user traffic ⚑️
</b>
</h3>
<p align="center">
🌟 The must-have tool for developers in the AI-Gen era 🌟
</p>

---

<h4 align="center">

<a href="https://twitter.com/Keploy_io">
<img src="https://img.shields.io/badge/follow-%40keployio-1DA1F2?logo=twitter&style=social" alt="Keploy Twitter" />
</a>

<a href="https://github.com/Keploy/Keploy/issues">
<img src="https://img.shields.io/github/stars/keploy/keploy?color=%23EAC54F&logo=github&label=Help us reach 4k stars! Now at:" alt="Help us reach 4k stars!" />
</a>

<a href="https://landscape.cncf.io/?item=app-definition-and-development--continuous-integration-delivery--keploy">
<img src="https://img.shields.io/badge/CNCF%20Landscape-5699C6?logo=cncf&style=social" alt="Keploy CNCF Landscape" />
</a>

[![Slack](https://img.shields.io/badge/Slack-4A154B?style=for-the-badge&logo=slack&logoColor=white)](https://join.slack.com/t/keploy/shared_invite/zt-2dno1yetd-Ec3el~tTwHYIHgGI0jPe7A)
[![LinkedIn](https://img.shields.io/badge/linkedin-%230077B5.svg?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/company/keploy/)
[![YouTube](https://img.shields.io/badge/YouTube-%23FF0000.svg?style=for-the-badge&logo=YouTube&logoColor=white)](https://www.youtube.com/channel/UC6OTg7F4o0WkmNtSoob34lg)
[![Twitter](https://img.shields.io/badge/Twitter-%231DA1F2.svg?style=for-the-badge&logo=Twitter&logoColor=white)](https://twitter.com/Keployio)

</h4>

# jsonDiff
`jsonDiff` is a Go package that allows you to compare JSON objects and return the differences as colorized strings.

## Features
- Compare two JSON objects and highlight the differences.
- Supports comparing headers of expected and actual maps.
- Provides colorized differences for easy visualization.

## Installation

```sh
go get github.com/keploy/jsonDiff
```

# Usage

## Comparing JSON Objects

```sh
package main

import (
"fmt"
"github.com/keploy/jsonDiff"
)

func main() {
json1 := []byte(`{"name": "Alice", "age": 30, "city": "New York"}`)
json2 := []byte(`{"name": "Alice", "age": 31, "city": "Los Angeles"}`)

diff, err := jsonDiff.ColorJSONDiff(json1, json2, nil)
if err != nil {
fmt.Println("Error:", err)
return
}

fmt.Println("Expected Response:")
fmt.Println(diff.ExpectedResponse)
fmt.Println("Actual Response:")
fmt.Println(diff.ActualResponse)
}
```
## Comparing Headers
```sh
package main

import (
"fmt"
"github.com/yourusername/jsonDiff"
)

func main() {
expectedHeaders := map[string]string{
"Content-Type": "application/json",
"Authorization": "Bearer token123",
}

actualHeaders := map[string]string{
"Content-Type": "application/json",
"Authorization": "Bearer token456",
}

diff := jsonDiff.ColorHeaderDiff(expectedHeaders, actualHeaders)

fmt.Println("Expected Headers:")
fmt.Println(diff.ExpectedResponse)
fmt.Println("Actual Headers:")
fmt.Println(diff.ActualResponse)
}

```
## πŸ‘¨πŸ»β€πŸ’» Let's Build Together! πŸ‘©πŸ»β€πŸ’»
Whether you're a newbie coder or a wizard πŸ§™β€β™€οΈ, your perspective is golden. Take a peek at our:
πŸ“œ [Contribution Guidelines](https://github.com/keploy/JsonDiff/blob/main/CONTRIBUTING.md)
❀️ [Code of Conduct](https://github.com/keploy/keploy/blob/main/CODE_OF_CONDUCT.md)

0 comments on commit 8b27f9e

Please sign in to comment.