Skip to content

sbt-mdoc destructively handles scalacOptions #1064

@eejbyfeldt

Description

@eejbyfeldt

I was trying out sbt-mdoc in a project where the -Wconf contains spaces. This resulted in warnings in for parsing -Wconf in the mdoc scala compilation.

Grepping the codebase I found code like:

case options =>
s"${settings.scalacOptions} ${options.map(_.value).mkString(" ")}"

which I believe then gets resplit
val options = removeDuplicatedOptions(scalacOptions.split("\\s+").filter(_.nonEmpty).toList)

but if any option contains a whitespace character this will not correctly reconstruct the arguments.

I don't think it ever safe to assume options do not contain whitespace characters. So the code should be changed so that assumption is not made.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions