<commit_before>package cmd

import (
	"fmt"
	"os"
	"path/filepath"
	"strings"

	"github.com/Azure/azure-sdk-for-go/tools/generator/autorest"
	"github.com/Azure/azure-sdk-for-go/tools/generator/autorest/model"
	"github.com/Azure/azure-sdk-for-go/tools/generator/validate"
)

type changelogContext struct {
	sdkRoot         string
	clnRoot         string
	specRoot        string
	commitHash      string
	codeGenVer      string
	readme          string
	removedPackages []packageOutput
}

func (ctx changelogContext) SDKRoot() string {
	return ctx.sdkRoot
}

func (ctx changelogContext) SDKCloneRoot() string {
	return ctx.clnRoot
}

func (ctx changelogContext) SpecRoot() string {
	return ctx.specRoot
}

func (ctx changelogContext) SpecCommitHash() string {
	return ctx.specRoot
}

func (ctx changelogContext) CodeGenVersion() string {
	return ctx.codeGenVer
}

func (ctx changelogContext) process(metadataLocation string) ([]autorest.ChangelogResult, error) {
	// get the metadata
	m := autorest.NewMetadataProcessorFromLocation(metadataLocation)
	metadataMap, err := m.Process()
	if err != nil {
		return nil, err
	}
	// validate the metadata output-folder
	if err := ctx.validateMetadata(metadataMap); err != nil {
		return nil, err
	}
	// generate the changelogs
	p := autorest.NewChangelogProcessorFromContext(ctx).WithLocation(metadataLocation).WithReadme(ctx.readme)
	changelogResults, err := p.Process(metadataMap)
	if err != nil {<commit_msg>mistook specRoot as commit hash previously, fix it (#14219)<commit_after>package cmd

import (
	"fmt"
	"os"
	"path/filepath"
	"strings"

	"github.com/Azure/azure-sdk-for-go/tools/generator/autorest"
	"github.com/Azure/azure-sdk-for-go/tools/generator/autorest/model"
	"github.com/Azure/azure-sdk-for-go/tools/generator/validate"
)

type changelogContext struct {
	sdkRoot         string
	clnRoot         string
	specRoot        string
	commitHash      string
	codeGenVer      string
	readme          string
	removedPackages []packageOutput
}

func (ctx changelogContext) SDKRoot() string {
	return ctx.sdkRoot
}

func (ctx changelogContext) SDKCloneRoot() string {
	return ctx.clnRoot
}

func (ctx changelogContext) SpecRoot() string {
	return ctx.specRoot
}

func (ctx changelogContext) SpecCommitHash() string {
	return ctx.commitHash
}

func (ctx changelogContext) CodeGenVersion() string {
	return ctx.codeGenVer
}

func (ctx changelogContext) process(metadataLocation string) ([]autorest.ChangelogResult, error) {
	// get the metadata
	m := autorest.NewMetadataProcessorFromLocation(metadataLocation)
	metadataMap, err := m.Process()
	if err != nil {
		return nil, err
	}
	// validate the metadata output-folder
	if err := ctx.validateMetadata(metadataMap); err != nil {
		return nil, err
	}
	// generate the changelogs
	p := autorest.NewChangelogProcessorFromContext(ctx).WithLocation(metadataLocation).WithReadme(ctx.readme)
	changelogResults, err := p.Process(metadataMap)
	if err != nil {
{'fraction_non_alphanumeric': 0.10522742701968771, 'fraction_numerical': 0.0016972165648336728, 'mean_word_length': 4.329113924050633, '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': '6063621', 'n_tokens_mistral': 970, 'n_tokens_neox': 959, 'n_words': 220}