New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.62: always inspects 0 files when using Cygwin git #6646
Comments
Thanks for the detailed report! I'm still not sure whether we'd fix or remove the git integration. @AlexWayfer I guess now you understand why I was so skeptical of adding this feature. 😆 |
It isn't as it breaks cops. |
I continued testing on macOS which shows more problems unrelated to Cygwin: If you run rubocop only for a subdirectory of the current repo you will also get 0 files to be analyzed. I tried 0.60 and 0.62, where only 0.60 analyzes files. This issue stems from the fact that
To summarize:
|
Another problem exists if you haven't added I'd say on a typical Windows machine this is the default. You might argue that developers likely run git. But your Windows-based CI server might not. Still, you might want to run rubocop there against your code that was transferred to the server by other means. |
I've had problems with having git's bash tools in my path historically. Conflicting with other tools. So I've opted out of it. Having to have bash tools available introduce a workflow problem because of this. If I install bash tools I run into problems with other tools I need for my work. But if I don't then I cannot use rubocop in VSCode and RubyMine etc. I'd be limited to running a separate bash console which then severely limits the usefulness of RuboCop. I'm maintaining the rubocop-sketchup extension as a tool for developers who develop extensions for SketchUp's Ruby API. SketchUp is a desktop application where the wast majority of users are on Windows - thus also our API users. Using I realize Windows isn't the typical platform for Ruby developers, but I make my plea for having these Windows platform issues reconsidered. @agross details issues with Cygwin that I'm not experience with. So I'm afraid I'm short on help there. I was looking briefly at the usage of Ideally I'd prefer that usage of rubocop reverted to being more flexible under Windows without having to have these additional constraints. |
Instead of checking for the All other problems (Cygwin and subdirs) would persist nonetheless. |
Instead of catching the |
That's reverted on |
I apologize to all of you about problems with |
Windows supports two git variants:
Description
git ls-files <path> ...
to get those filesD:/projects/foo
)0
(success)/cygdrive
by default, e.g./cygdrive/d/projects/foo
/d/projects/foo
git_files
arrayDiscussion
I see that the root cause is git which should (perhaps?) error out if
ls-files
is invoked with a directory that does not exist.Expected behavior
All files are inspected.
Perhaps treat
git_files.empty?
likegit_files.nil?
.Actual behavior
No files are inspected effectively disabling rubocop.
Steps to reproduce the problem
git/RuboCop version
The text was updated successfully, but these errors were encountered: