1

I'm trying to pipe filnames into Rubocop as such:

$ git diff --name-only | tr '\n' ' ' | rubocop

However Rubocop still checks all project files.

Is there something wrong on my piping? On Rubocop? Somewhere else?

bjacquet
  • 21
  • 3

1 Answers1

1

I'm answering myself because I discovered how to do it using xargs.

$ git diff --name-only | xargs rubocop

bjacquet
  • 21
  • 3