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

Use the semantic versioning scheme when parsing Scala version #53

Closed
mwz opened this issue Apr 28, 2018 · 1 comment
Closed

Use the semantic versioning scheme when parsing Scala version #53

mwz opened this issue Apr 28, 2018 · 1 comment
Labels
Projects

Comments

@mwz
Copy link
Owner

@mwz mwz commented Apr 28, 2018

Currently, the way the Scoverage sensor parses Scala version in ScoverageSensorInternal.getDefaultScoverageReportPathrequires the major, minor, and the patch versions to be present and it will fail in cases where either the user doesn't specify a patch version or, for some reasons, the patch version includes more than one identifier (subversions), which is allowed by semver e.g. 2.12, 2.12.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92 etc.

We should parse the version so that only the major and minor versions are mandatory and the patch version is optional, e.g. 2.11, 2.12 should be allowed.

@mwz mwz added the scoverage label Apr 28, 2018
@mwz mwz changed the title Use a the semantic versioning scheme when parsing Scala version Use the semantic versioning scheme when parsing Scala version Apr 28, 2018
@mwz mwz closed this in #54 May 10, 2018
@mwz

This comment has been minimized.

Copy link
Owner Author

@mwz mwz commented May 10, 2018

Something that we missed in #54 is that the tokenize function is called for each file which results in the sonar.scala.version warning message being printed also for each file which is totally unnecessary and we should avoid that. A good idea would be to get Scala version once when the ScalaSensor is executed and we can then pass it down from there to the tokenize function.

See an example log:

[info] INFO: Sensor Scala Sensor [scala]
WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.11.0'
WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.11.0'
WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.11.0'
WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.11.0'
WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.11.0'
WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.11.0'
WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.11.0'
WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.11.0'
WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.11.0'
WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.11.0'
WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.11.0'
WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.11.0'
WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.11.0'
WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.11.0'
WARN: [sonar-scala] The 'sonar.scala.version' is not properly set or is missing, using the default value: '2.11.0'
[info] INFO: Sensor Scala Sensor [scala] (done) | time=148ms
[info] INFO: Sensor Scoverage Sensor [scala]
[info] INFO: [scoverage] Initializing the scoverage sensor.

Update: Fixed in #58.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
sonar-scala
  
Done
1 participant
You can’t perform that action at this time.