<commit_before>package steve

import com.datasift.dropwizard.scala.ScalaApplication
import com.google.inject.Stage
import com.hubspot.dropwizard.guice.GuiceBundle
import com.typesafe.config.ConfigFactory
import health.SteveHealthCheck
import io.dropwizard.setup.{Bootstrap, Environment}
import org.flywaydb.core.Flyway

object SteveServer extends ScalaApplication[SteveConfiguration] {
  val guiceBundle = GuiceBundle.newBuilder()
    .addModule(new SteveModule)
    .enableAutoConfig("controller", "steve")
    .setConfigClass(classOf[SteveConfiguration])
    .build(Stage.PRODUCTION)

  override def init(bootstrap: Bootstrap[SteveConfiguration]): Unit = {
    val flyway = new Flyway()
    val dbConfig = ConfigFactory.load().getConfig("steveDatasource.properties")
    val jdbcURL = s"jdbc:postgresql://${dbConfig.getString("serverName")}:${dbConfig.getString("portNumber")}/${dbConfig.getString("databaseName")}"
    flyway.setDataSource(jdbcURL, dbConfig.getString("user"), dbConfig.getString("password"))
    flyway.migrate()
    bootstrap.addBundle(guiceBundle)
  }

  override def run(configuration: SteveConfiguration, environment: Environment): Unit = {
    environment.healthChecks().register("steve", new SteveHealthCheck)
    environment.jersey().setUrlPattern("/*")
  }
}
<commit_msg>Resolve so we can substitute environment variables (if any) in the YAML.<commit_after>package steve

import com.datasift.dropwizard.scala.ScalaApplication
import com.google.inject.Stage
import com.hubspot.dropwizard.guice.GuiceBundle
import com.typesafe.config.ConfigFactory
import health.SteveHealthCheck
import io.dropwizard.setup.{Bootstrap, Environment}
import org.flywaydb.core.Flyway

object SteveServer extends ScalaApplication[SteveConfiguration] {
  val guiceBundle = GuiceBundle.newBuilder()
    .addModule(new SteveModule)
    .enableAutoConfig("controller", "steve")
    .setConfigClass(classOf[SteveConfiguration])
    .build(Stage.PRODUCTION)

  override def init(bootstrap: Bootstrap[SteveConfiguration]): Unit = {
    val flyway = new Flyway()
    val dbConfig = ConfigFactory.load().getConfig("steveDatasource.properties").resolve()
    val jdbcURL = s"jdbc:postgresql://${dbConfig.getString("serverName")}:${dbConfig.getString("portNumber")}/${dbConfig.getString("databaseName")}"
    flyway.setDataSource(jdbcURL, dbConfig.getString("user"), dbConfig.getString("password"))
    flyway.migrate()
    bootstrap.addBundle(guiceBundle)
  }

  override def run(configuration: SteveConfiguration, environment: Environment): Unit = {
    environment.healthChecks().register("steve", new SteveHealthCheck)
    environment.jersey().setUrlPattern("/*")
  }
}

{'fraction_non_alphanumeric': 0.12148481439820022, 'fraction_numerical': 0.0, 'mean_word_length': 6.095744680851064, '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': '3396116', 'n_tokens_mistral': 788, 'n_tokens_neox': 757, 'n_words': 133}