Skip to content

Instantly share code, notes, and snippets.

@jjb
Created June 20, 2023 02:15
Show Gist options
  • Save jjb/d7dc9f4e333dde90107a22c6bc222aeb to your computer and use it in GitHub Desktop.
Save jjb/d7dc9f4e333dde90107a22c6bc222aeb to your computer and use it in GitHub Desktop.
How to see which rubocop file is being evaluated

If you are in a situation where rubocop is hanging on a file but you don't know which one, afaik there is no way to have rubocop pring each filename as it runs it. None of the formatters do this and there is no verbose mode. Even --debug does not do this.

Here is a hack to (very slowly) invoke rubocop once for each candidate file:

bundle exec rubocop --list-target-files > files.txt
cat files.txt | xargs -L1 -n1 bundle exec rubocop # this works on macos/bsd, use --verbose instead of -t on linux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment