Closed dmorgan-fa closed 4 months ago
Hi, I've just started using rubocop-gradual and so far found it really useful, so thanks for creating and maintaining the gem!
rubocop-gradual
One issue I ran into was on file deletion, rubocop-gradual --staged run's into a RuboCop error:
rubocop-gradual --staged
RuboCop Error: No such file or directory: [...]/file-that-I'm-deleteing.rb
I noticed that --staged is just shelling out git diff: https://github.com/skryukov/rubocop-gradual/blob/c6b8d7f28b5eee20483db2b427c0ab29ebfc7f88/lib/rubocop/gradual/git.rb#L17
--staged
git diff
So I reckon the simplest fix would be to use --diff-filter (docs):
--diff-filter
`git diff --cached --name-only --diff-filter=d`.split("\n") # excludes deleted files
Hi, I've just started using
rubocop-gradual
and so far found it really useful, so thanks for creating and maintaining the gem!One issue I ran into was on file deletion,
rubocop-gradual --staged
run's into a RuboCop error:I noticed that
--staged
is just shelling outgit diff
: https://github.com/skryukov/rubocop-gradual/blob/c6b8d7f28b5eee20483db2b427c0ab29ebfc7f88/lib/rubocop/gradual/git.rb#L17So I reckon the simplest fix would be to use
--diff-filter
(docs):