Skip to content

Not able to find a InputFile with R/tests/testthat.R  #17

Description

@nicolasfguillaume

The plugin is able to find and lint source files, but not able to find test files:

ERROR: Not able to find a InputFile with R/tests/testthat.R

However, in the logs I can see that this test file was indexed correctly:

'R/tests/testthat.R' indexed as test with language 'r' 

Also, I made sure to define the properties in sonar-project.properties:

sonar.sources=R/R/
sonar.tests=R/tests/

In the source of the plugin, I can see in the function processIssue in file https://github.com/Merck/sonar-r-plugin/blob/master/src/main/java/com/msd/gin/common/sonar/LintRSensor.java#L97 that the InputFile type expected is MAIN InputFile.Type.MAIN (and not TEST), which makes me think that the test files are excluded from linting.

This is even more surprising because there are test files in the json file in the sample-project (https://github.com/Merck/sonar-r-plugin/blob/master/sample-project/lintr_out.json#L390).

Please advise.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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