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

sourceroot not used by cli tool #176

Closed
stuhood opened this issue May 31, 2017 · 2 comments
Closed

sourceroot not used by cli tool #176

stuhood opened this issue May 31, 2017 · 2 comments
Milestone

Comments

@stuhood
Copy link
Contributor

stuhood commented May 31, 2017

The CLI tool does not use the sourceroot value that is passed in, and the result is that the files that are operated on are always the ones relative to CWD.

The Input values that come from the scalameta database will be Input.LabeledString (afaict), with relative paths names as the labels. scalafix will need to convert these to absolute paths using the supplied sourceroot.

@olafurpg
Copy link
Contributor

Good catch! In sbt, the working directory is the same as CWD so this didn't get caugt in tests.

The absolute path is inferred from the working directory here:

def path = input.path(common.workingPath)

The CliRunner should instead use a sourceroot field passed as a constructor parameter here

I will try to take a look at this at the spree today.

PS. This reminds me scalafix should have a RemoveUnusedDefns rewrite to remove unused definitions like resolvedSourceroot.

@stuhood
Copy link
Contributor Author

stuhood commented Jun 2, 2017

Thanks for #183!

@olafurpg olafurpg modified the milestone: v0.4.1 Jun 7, 2017
bjaglin pushed a commit to liancheng/scalafix that referenced this issue May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants