Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more options #142

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/src/main/scala/org/typelevel/scalacoptions/ScalacOptions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ private[scalacoptions] trait ScalacOptions {
): ScalacOption =
ScalacOption(option, args, isSupported)

/** Set the encoding to UTF-8 */
val encodingUTF8 = encoding("utf8")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure including this option is necessary, We already include utf encoding in default options:

Copy link
Contributor Author

@geirolz geirolz Sep 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just because it's widely used with UTF-8, I've always seen this setting set with UTF-8


/** Specify character encoding used by source files.
*/
def encoding(enc: String) =
Expand All @@ -60,6 +63,12 @@ private[scalacoptions] trait ScalacOptions {
val feature =
ScalacOption("-feature", _ => true)

/** Turn on bracket-less style */
val indent = other("-indent", _ >= V3_0_0)

/** Turn off bracket-less style */
val noIndent = other("-no-indent", _ >= V3_0_0)

/** Compile for a specific version of the Java platform. Supported targets: 8, 9, ..., 17, 18.
*
* The release flag is supported only on JDK 9 and above, since it relies on the functionality
Expand Down Expand Up @@ -157,6 +166,10 @@ private[scalacoptions] trait ScalacOptions {
val languageStrictEquality =
languageFeatureOption("strictEquality", version => version >= V3_0_0)

/** Enable dynamics support. */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also wondering is this worth adding, dynamics seems not a popular choice and it's not too much hassle to use languageFeatureOption("dynamics") directly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using it in some project and I though i'd be useful - If isn't we can remove it, np

val languageDynamics =
languageFeatureOption("dynamics")

/** Preferred language feature options.
*/
val languageFeatureOptions: Set[ScalacOption] = ListSet(
Expand Down