ruumba
ruumba copied to clipboard
Ruumba not finding any files.
For some reason ruumba is not finding any files to lint. I've tried running the basic ruumba commands without a .ruumba.yml
file and with a default .ruumba.yml
config but both yield 0 files inspected, no offenses detected
Commands run are bin/ruumba ./
bundle exec ruumba ./
bundle exec ruumba app/views
ruumba -D -e app/views -c .ruumba.yml
Even running on a specific file is still returning 0 files inspected
.
Can anyone provide some insight on why this could be happening?
Contents of .ruumba.yml
is:
inherit_from: .rubocop.yml
AllCops:
Include:
- '**/*.erb'
# The following cops are not applicable to ERB files
Style/CommentedKeyword:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
# Arguably all 'Layout' cops are not applicable
Layout/AlignHash:
Enabled: false
Layout/AlignParameters:
Enabled: false
Layout/BlockAlignment:
Enabled: false
Layout/CaseIndentation:
Enabled: false
Layout/ClosingParenthesisIndentation:
Enabled: false
Layout/CommentIndentation:
Enabled: false
Layout/ConditionPosition:
Enabled: false
Layout/EndAlignment:
Enabled: false
Layout/ElseAlignment:
Enabled: false
Layout/EmptyLines:
Enabled: false
Layout/EmptyLinesAroundBlockBody:
Enabled: false
Layout/ExtraSpacing:
Enabled: false
Layout/IndentFirstArgument:
Enabled: false
Layout/IndentFirstArrayElement:
Enabled: false
Layout/IndentationConsistency:
Enabled: false
Layout/IndentationWidth:
Enabled: false
Layout/IndentFirstHashElement:
Enabled: false
Layout/InitialIndentation:
Enabled: false
Layout/LeadingBlankLines:
Enabled: false
Layout/LeadingCommentSpace:
Enabled: false
Layout/MultilineMethodCallBraceLayout:
Enabled: false
Layout/MultilineMethodCallIndentation:
Enabled: false
Layout/SpaceAfterColon:
Enabled: false
Layout/SpaceAfterComma:
Enabled: false
Layout/SpaceAroundOperators:
Enabled: false
Layout/SpaceBeforeBlockBraces:
Enabled: false
Layout/SpaceBeforeComma:
Enabled: false
Layout/SpaceBeforeComment:
Enabled: false
Layout/SpaceBeforeFirstArg:
Enabled: false
Layout/SpaceBeforeSemicolon:
Enabled: false
Layout/SpaceInsideArrayLiteralBrackets:
Enabled: false
Layout/SpaceInsideBlockBraces:
Enabled: false
Layout/SpaceInsideHashLiteralBraces:
Enabled: false
Layout/SpaceInsideParens:
Enabled: false
Layout/SpaceInsideStringInterpolation:
Enabled: false
Layout/TrailingBlankLines:
Enabled: false
Layout/TrailingWhitespace:
Enabled: false
# Incorrectly flagged by Ruumba
# Typically the false positives relate to important HTML differences which aren't
# inside ERB tags and so aren't detected correctly by Ruumba.
# TODO: Monitor these, and re-enable permanently once Ruumba flags correctly.
Lint/Void:
Enabled: false
Lint/EmptyWhen:
Enabled: false
Style/EmptyElse:
Enabled: false
Style/IdenticalConditionalBranches:
Enabled: false
Style/IfInsideElse:
Enabled: false
Style/IfUnlessModifier:
Enabled: false
Style/Next:
Enabled: false
Style/UnneededCondition:
Enabled: false
# TODO: Enable cops below and resolve violations.
# Note: The `--auto-gen-config` flag is glitchy with `ruumba`.
# To re-generate this list;
# - delete all rules below this comment and save.
# - run `bin/ruumba`
# - Copy full output (many errors + warnings!)
# - Use text manipulation to extract occurrences of `: C: XXXX/YYYY` and `: W: XXXX/YYYY`
# - De-duplicate and sort the matching cop names
# - Paste below and manipulate to be `Enabled: false` in each case.
Metrics/BlockLength:
Enabled: false
Metrics/BlockNesting:
Enabled: false
Metrics/LineLength:
Enabled: false
Style/BlockDelimiters:
Enabled: false
Style/BracesAroundHashParameters:
Enabled: false
Style/MultilineIfModifier:
Enabled: false
Style/NestedParenthesizedCalls:
Enabled: false
Style/NestedTernaryOperator:
Enabled: false
Style/Semicolon:
Enabled: false
Style/StringLiterals:
Enabled: false
Style/SymbolProc:
Enabled: false
Style/TernaryParentheses:
Enabled: false
Style/ZeroLengthPredicate:
Enabled: false
@JamesDullaghan Thanks for reporting! I'll spin up a minimal Rails app and see if I can reproduce. Can you confirm which version of Ruumba you're running?
@ericqweinstein the version number is 0.1.13
. Thanks for taking a look, it's appreciated.
@ericqweinstein were you by chance able to spin something up? For whatever reason this is still an issue for me and can't figure out of it's with my setup or with the library itself.
(I'm using rbenv here):
$ gem install rails
[...]
$ rails new ruumba
[...]
$ cd ruumba
$ echo "gem 'ruumba'" >> Gemfile
$ bundle install
$ bundle exec ruumba --version
ruumba 0.1.14
$ bundle exec ruumba
[...]
3 files inspected, 37 offenses detected
$ bundle exec ruumba app/views
[...]
3 files inspected, 37 offenses detected
$ bundle exec ruumba app/views/layouts/application.html.erb
[...]
1 file inspected, 18 offenses detected
This seems fine?
@JamesDullaghan I'm getting the same results as @aclemons. I'll dig in some more today, but in the meantime, could you try upgrading to 0.1.14?
Same issue here. MacOs Catalina 10.15.1 (19B88).
This warning occurred when I installed ruumba with gem install
. On both version 0.1.13 and 0.1.14.
➜ gem install ruumba
Fetching ruumba-0.1.14.gem
Successfully installed ruumba-0.1.14
Parsing documentation for ruumba-0.1.14
Installing ri documentation for ruumba-0.1.14
Done installing documentation for ruumba after 0 seconds
1 gem installed
➜ ruumba
/Users/***/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/ruumba-0.1.14/lib/ruumba/analyzer.rb:59: warning: instance variable @stdin_contents not initialized
Inspecting 0 files
0 files inspected, no offenses detected
This warning doesn't show up if I install it with bundle install
(the version in my gemfile is 0.1.13).
Not sure if it's relevant. Hope it helps the investigation.
Hi @FunnyHector,
Thanks for reporting! The warning is unrelated to the issue at hand; I'll put a fix in soon. I'm only able to reproduce this behavior when I run $ ruumba
in a directory with no .erb
files; running in a fresh Rails app, I get the same results as @aclemons.
Could either you or @JamesDullaghan share a minimal Rails app that reproduces this error? I'll pull down the repo, run locally, and will put a fix in once I can reproduce.
@ericqweinstein Thanks for the response. I've tried with 0.1.14
and am still receiving the same errors.
I'll create a minimal rails app to reproduce as soon as I have a minute. Thanks for your patience and maintaining this gem.
This may not be the same issue, but I was noticing I get Inspecting 0 files
whenever I include
AllCops:
Include:
- '**/*.erb'
in .ruumba.yml As soon as I remove it, it scans files again as expected
@matthewhively Thanks for this! I'll try to reproduce this weekend and start on a fix once I understand the bug.
@matthewhively Just confirming you are passing in -e
or --disable-ruby-ext
when invoking ruumba? Otherwise all files will be renamed to blah.erb.rb when copying to the temp directory and that in combination with the filter '**/*.erb' will mean there are no files to scan.
@matthewhively I haven't been able to reproduce—when you have a moment, could you confirm @aclemons' ask, above?
To confirm, when running ruumba -e
it does detect the files, but without the -e
it does not.
I suppose the readme is a bit confusing. I'm not sure what the section Fix Paths and Non-Applicable Cops
is entirely talking about.
From the documentation:
By default, RuboCop only scans .rb files and so does Ruumba. If you want shown paths to reflect original paths...
So it looks like we're disabling the auto-append of .rb
and manually including .erb files.
Test 1:
.ruumba.yml with include all line.
ruumba -PL -e
-- successfully listed files
Test 2:
.ruumba.yml without include all line.
ruumba -PL -e
-- lists no files, seems correct
Test 3:
.ruumba.yml without include all line.
ruumba -PL
-- lists all files, paths still look correct though
My understanding is that the paths would have been altered in some way?
Please clarify the documentation.
Sure thing—I'll review the docs this weekend.
Ah yeah, I agree that section in particular is confusing. I'll update the README; in the meantime, -e
should get you the behavior you're looking for.
@ericqweinstein Thanks!