<commit_before>package models

import (
  "path"
  "io/ioutil"
  "os"
  "encoding/json"
  "ghighlighter/utils"
)

type GhConfig struct {
  AccessToken string ""
  ReadmillUsername string ""
}

func configFilePath() string {
  return path.Join(utils.DataDir(), "config.json")
}

func (m *GhConfig) Read() {
  data, error := ioutil.ReadFile(configFilePath())
  if error != nil && !os.IsExist(error) {
    m.Write()
    m.Read()
  }
  var tmpConfig GhConfig
  json.Unmarshal(data, &tmpConfig)

  m.AccessToken = tmpConfig.AccessToken
  m.ReadmillUsername = tmpConfig.ReadmillUsername
}

func (m *GhConfig) Write() {
  data, error := json.Marshal(m)
  if error != nil { return }

  error = ioutil.WriteFile(configFilePath(), data, 0755)
}

func Config() *GhConfig {
  config := GhConfig{}
  config.Read()
  return &config
}
<commit_msg>Remove ReadmillUsername from Config<commit_after>package models

import (
  "path"
  "io/ioutil"
  "os"
  "encoding/json"
  "ghighlighter/utils"
)

type GhConfig struct {
  AccessToken string ""
}

func configFilePath() string {
  return path.Join(utils.DataDir(), "config.json")
}

func (m *GhConfig) Read() {
  data, error := ioutil.ReadFile(configFilePath())
  if error != nil && !os.IsExist(error) {
    m.Write()
    m.Read()
  }
  var tmpConfig GhConfig
  json.Unmarshal(data, &tmpConfig)

  m.AccessToken = tmpConfig.AccessToken
}

func (m *GhConfig) Write() {
  data, error := json.Marshal(m)
  if error != nil { return }

  error = ioutil.WriteFile(configFilePath(), data, 0755)
}

func Config() *GhConfig {
  config := GhConfig{}
  config.Read()
  return &config
}

{'fraction_non_alphanumeric': 0.14374611076540136, 'fraction_numerical': 0.004978220286247666, 'mean_word_length': 3.8727272727272726, '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': '4991134', 'n_tokens_mistral': 587, 'n_tokens_neox': 568, 'n_words': 131}