{"id":29879426,"url":"https://github.com/typelevel/scalac-options","last_synced_at":"2026-05-01T14:02:05.549Z","repository":{"id":51611243,"uuid":"520502877","full_name":"typelevel/scalac-options","owner":"typelevel","description":"A library for configuring scalac options","archived":false,"fork":false,"pushed_at":"2026-04-07T22:43:55.000Z","size":242,"stargazers_count":48,"open_issues_count":15,"forks_count":18,"subscribers_count":9,"default_branch":"main","last_synced_at":"2026-04-08T00:26:02.273Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/typelevel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"typelevel","open_collective":"typelevel-foundation"}},"created_at":"2022-08-02T13:08:55.000Z","updated_at":"2026-04-07T22:43:53.000Z","dependencies_parsed_at":"2023-02-13T19:01:10.499Z","dependency_job_id":"c2ad5869-e80d-4677-b7dc-79bd890ac66d","html_url":"https://github.com/typelevel/scalac-options","commit_stats":{"total_commits":180,"total_committers":10,"mean_commits":18.0,"dds":"0.18888888888888888","last_synced_commit":"681b9a7d094ce2d0c93d0bd48ea644c135e29e42"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/typelevel/scalac-options","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typelevel%2Fscalac-options","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typelevel%2Fscalac-options/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typelevel%2Fscalac-options/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typelevel%2Fscalac-options/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typelevel","download_url":"https://codeload.github.com/typelevel/scalac-options/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typelevel%2Fscalac-options/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32499691,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-31T08:45:56.192Z","updated_at":"2026-05-01T14:02:05.536Z","avatar_url":"https://github.com/typelevel.png","language":"Scala","funding_links":["https://github.com/sponsors/typelevel","https://opencollective.com/typelevel-foundation"],"categories":[],"sub_categories":[],"readme":"# scalac-options\n\n[![Continuous Integration](https://github.com/typelevel/scalac-options/actions/workflows/ci.yml/badge.svg)](https://github.com/typelevel/scalac-options/actions/workflows/ci.yml)\n[![License](https://img.shields.io/github/license/typelevel/scalac-options.svg)](https://opensource.org/licenses/Apache-2.0)\n[![Discord](https://img.shields.io/discord/632277896739946517.svg?label=\u0026logo=discord\u0026logoColor=ffffff\u0026color=404244\u0026labelColor=6A7EC2)](https://discord.gg/D7wY3aH7BQ)\n[![Maven Central](https://img.shields.io/maven-central/v/org.typelevel/scalac-options_3)](https://search.maven.org/artifact/org.typelevel/scalac-options_3)\n\n*scalac-options* is a library containing logic for configuring Scala compiler options according to the current Scala compiler version.\n\nThis logic was originally developed in the [sbt-tpolecat](https://github.com/typelevel/sbt-tpolecat) sbt plugin, and this library is intended to enable the reuse of that logic in other build tool plugins, for example [sbt-typelevel](https://github.com/typelevel/sbt-typelevel) and [mill-tpolecat](https://github.com/DavidGregory084/mill-tpolecat).\n\n## Usage\n\nThis library is published for Scala 2.12.x, 2.13.x and 3.1.x:\n\n```scala\n// sbt\n\"org.typelevel\" %% \"scalac-options\" % \"0.1.8\"\n\n// mill\nivy\"org.typelevel::scalac-options:0.1.8\"\n\n// Scala CLI\n//\u003e using dep org.typelevel::scalac-options:0.1.8\n```\n\nThis library offers functions for filtering proposed Scala compiler options according to Scala version:\n\n```scala\nscalacOptions := ScalacOptions.tokensForVersion(\n  ScalaVersion.V3_1_0, // the Scala compiler major, minor, patch version\n  ScalacOptions.default // a curated default option set\n) // returns a Seq[String] of Scala compiler options\n\nScalacOptions.optionsForVersion(\n  ScalaVersion.V3_1_0,\n  ScalacOptions.default\n) // returns a Set[ScalacOption]\n```\n\nA shorthand for using the default option set is also provided:\n\n```scala\nscalacOptions := ScalacOptions.defaultTokensForVersion(\n  ScalaVersion.V3_1_0\n) // returns a Seq[String] of Scala compiler options based on the default option set\n\nScalacOptions.defaultOptionsForVersion(\n  ScalaVersion.V3_1_0\n) // returns a Set[ScalacOption] based on the default option set\n```\n\nThe following are simple examples of use in sbt and Mill. Note that they are not complete project definitions.\n\n### Modifying options: Fatal warnings example\n\nA common requirement is use a modified version of the default settings. In this example, we are going to enable fatal warnings.\n\n```scala\nScalacOptions.tokensForVersion(\n  ScalaVersion.V3_1_0,\n  ScalacOptions.default ++ ScalacOptions.fatalWarningOptions\n)\n```\n\n### sbt example\n\nAdd the following dependency to an `sbt` file within the project directory, for instance `project/plugins`:\n\n```scala\nlibraryDependencies += \"org.typelevel\" %% \"scalac-options\" % \"0.1.8\"\n```\n\nAlter your `build.sbt` file as follows:\n\n```scala\n// Types are not imported directly to avoid collisions with sbt's classes.\nimport org.typelevel.scalacoptions\n\nval scala3Version = \"3.3.6\"\n\nproject\n  .settings(\n    scalaVersion := scala3Version,\n    scalacOptions ++= scalacoptions.ScalacOptions.defaultTokensForVersion(\n      scalacoptions.ScalaVersion.unsafeFromString(scala3Version)\n    )\n  )\n```\n\n### Mill example\n\nIf you are using mill 1.x:\n\n```scala\n//| mvnDeps: [\"org.typelevel::scalac-options:0.1.8\"]\nimport org.typelevel.scalacoptions.*\n\nobject example extends ScalaModule {\n  def scalaVersion   = \"3.3.6\"\n\n  override def scalacOptions = Task {\n    super.scalacOptions() ++\n      ScalacOptions.defaultTokensForVersion(\n        ScalaVersion.unsafeFromString(scalaVersion())\n      )\n  }\n}\n```\n\nIf you are using mill 0.x:\n\n```scala\nimport $ivy.`org.typelevel::scalac-options:0.1.8`, org.typelevel.scalacoptions._\n\nobject example extends ScalaModule {\n  def scalaVersion   = \"3.3.6\"\n\n  override def scalacOptions = T {\n    super.scalacOptions() ++\n      ScalacOptions.defaultTokensForVersion(\n        ScalaVersion.unsafeFromString(scalaVersion())\n      )\n  }\n}\n```\n\n## Conduct\n\nParticipants are expected to follow the [Scala Code of Conduct](https://www.scala-lang.org/conduct/) while discussing the project on GitHub and any other venues associated with the project. See the [organizational Code of Conduct](https://github.com/typelevel/.github/blob/main/CODE_OF_CONDUCT.md) for more details.\n\n## License\n\nAll code in this repository is licensed under the Apache License, Version 2.0. See [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypelevel%2Fscalac-options","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypelevel%2Fscalac-options","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypelevel%2Fscalac-options/lists"}