<commit_before>package cmd

import (
	"fmt"

	"github.com/SpectoLabs/hoverfly/hoverctl/wrapper"
	"github.com/spf13/cobra"
	"github.com/SpectoLabs/hoverfly/core/handlers/v2"
	"bytes"
)

var diffStoreCmd = &cobra.Command{
	Use:   "diff-store",
	Short: "Manage the diffs for Hoverfly",
	Long: `
This allows you to get or clean the differences 
between expected and actual responses stored by 
the Diff mode in Hoverfly. The diffs are represented 
as lists of strings grouped by the same requests.
	`,
}

const errorMsgTemplate = "The \"%s\" parameter is not same - the expected value was [%s], but the actual one [%s]\n"

var getAllDiffStoreCmd = &cobra.Command{
	Use:   "get-all",
	Short: "Gets all diffs stored in Hoverfly",
	Long: `
Returns all differences between expected and actual responses from Hoverfly.
	`,
	Run: func(cmd *cobra.Command, args []string) {

		checkTargetAndExit(target)

		if len(args) == 0 {
			diffs, err := wrapper.GetAllDiffs(*target)
			handleIfError(err)

			output := ""
			for _, diffsWithRequest := range diffs {
				output = fmt.Sprintf("\nFor the request with the simple definition:\n"+
					"\n Method: %s \n Host: %s \n Path: %s \n Query:  %s \n\nhave been recorded %s diff(s):\n",
					diffsWithRequest.Request.Method,
					diffsWithRequest.Request.Host,
					diffsWithRequest.Request.Path,
					diffsWithRequest.Request.Query,
					fmt.Sprint(len(diffsWithRequest.DiffReport)))

				for index, diff := range diffsWithRequest.DiffReport {
					output = output + "\n[" + fmt.Sprint(index+1) + ".]\n" + diffReportMessage(diff) + "\n"
				}
			}
<commit_msg>fix: diff - added missing timestamp to the hoverctl output of<commit_after>package cmd

import (
	"fmt"

	"github.com/SpectoLabs/hoverfly/hoverctl/wrapper"
	"github.com/spf13/cobra"
	"github.com/SpectoLabs/hoverfly/core/handlers/v2"
	"bytes"
)

var diffStoreCmd = &cobra.Command{
	Use:   "diff-store",
	Short: "Manage the diffs for Hoverfly",
	Long: `
This allows you to get or clean the differences 
between expected and actual responses stored by 
the Diff mode in Hoverfly. The diffs are represented 
as lists of strings grouped by the same requests.
	`,
}

const errorMsgTemplate = "The \"%s\" parameter is not same - the expected value was [%s], but the actual one [%s]\n"

var getAllDiffStoreCmd = &cobra.Command{
	Use:   "get-all",
	Short: "Gets all diffs stored in Hoverfly",
	Long: `
Returns all differences between expected and actual responses from Hoverfly.
	`,
	Run: func(cmd *cobra.Command, args []string) {

		checkTargetAndExit(target)

		if len(args) == 0 {
			diffs, err := wrapper.GetAllDiffs(*target)
			handleIfError(err)

			output := ""
			for _, diffsWithRequest := range diffs {
				output = fmt.Sprintf("\nFor the request with the simple definition:\n"+
					"\n Method: %s \n Host: %s \n Path: %s \n Query:  %s \n\nhave been recorded %s diff(s):\n",
					diffsWithRequest.Request.Method,
					diffsWithRequest.Request.Host,
					diffsWithRequest.Request.Path,
					diffsWithRequest.Request.Query,
					fmt.Sprint(len(diffsWithRequest.DiffReport)))

				for index, diff := range diffsWithRequest.DiffReport {
					output = output + fmt.Sprintf("\n%s. recorded at %s\n%s\n", fmt.Sprint(index+1), diff.Timestamp, diffReportMessage(diff))
				}
			}

{'fraction_non_alphanumeric': 0.12193627450980392, 'fraction_numerical': 0.0030637254901960784, 'mean_word_length': 3.7733918128654973, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4302044', 'n_tokens_mistral': 1220, 'n_tokens_neox': 1097, 'n_words': 321}