Skip to content

Commit fb43c38

Browse files
committed
Use Bazel.execute for java lint task
1 parent 42c4b1f commit fb43c38

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

rake_tasks/java.rake

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,10 @@ end
377377

378378
desc 'Run Java formatter (google-java-format)'
379379
task :lint do
380-
# linting is defined in .bazelrc as part of build
381380
puts ' Running google-java-format...'
382-
formatter = `bazel run --run_under=echo //scripts:google-java-format 2>/dev/null`.strip
381+
formatter = nil
382+
Bazel.execute('run', ['--run_under=echo'], '//scripts:google-java-format') do |output|
383+
formatter = output.strip
384+
end
383385
sh formatter, '--replace', *Dir.glob('java/**/*.java')
384386
end

0 commit comments

Comments
 (0)