Skip to content

Instantly share code, notes, and snippets.

@senthilnayagam
Created May 8, 2015 08:03
Show Gist options
  • Save senthilnayagam/7af18c65104e160f6251 to your computer and use it in GitHub Desktop.
Save senthilnayagam/7af18c65104e160f6251 to your computer and use it in GitHub Desktop.
ruby syntax checker
git ls-files | grep '\.rb$' | xargs -I FILE -- sh -c 'echo FILE ; ruby -c FILE '
@senthilnayagam
Copy link
Author

this can also be modified with 'ruby -c' replaced with 'python -m py_compile' to syntax check for python as well

@senthilnayagam
Copy link
Author

I learnt how to pass arguments to multiple commands when using xargs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment