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

Reads .bazel_fix_commands.json from current directory #373

Closed
deadmoose opened this issue Apr 13, 2020 · 1 comment
Closed

Reads .bazel_fix_commands.json from current directory #373

deadmoose opened this issue Apr 13, 2020 · 1 comment

Comments

@deadmoose
Copy link

--run_output is documented as:

Search for commands in Bazel output that match a regex and execute them, the default path of file should be in the workspace root .bazel_fix_commands.json

Calling that "the default path" is a bit of a misnomer since it's hardcoded, and then it just directly os.Opens that, so it looks in whatever your working dir happens to be.

@achew22
Copy link
Member

achew22 commented Apr 13, 2020

@deadmoose yep, you're 100% right on this. I also think it's a bug. It should prepend the workspace

Useful links:

This looks like a fairly simple simple fix to:

  1. Update New to set a new field on the OutputRunner struct, wf workspace_finder.WorkspaceFinder to a freshly constructed workspace_finder.MainWorkspaceFinder.
  2. Update readConfigs to take a workspace_finder.WorkspaceFinder and call FindWorkspace on that object then filepath.Join it with the preexisting filename in the open statement.
  3. Update the test to pass in a workspace_finder.FakeWorkspaceFinder.

Is this something you'd be interested in taking on?

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