Skip to content
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

Lint/EmptyFile throws error when html formatter is used #8669

Closed
roberts1000 opened this issue Sep 8, 2020 · 0 comments · Fixed by #8676
Closed

Lint/EmptyFile throws error when html formatter is used #8669

roberts1000 opened this issue Sep 8, 2020 · 0 comments · Fixed by #8676

Comments

@roberts1000
Copy link
Contributor

roberts1000 commented Sep 8, 2020

Lint/EmptyFile (added in 0,90.0) throws an error when the html formatter is used.

Steps to Reproduce

  1. Enable the cop in a .rubocop.yml

    Lint/EmptyFile:
      Enabled: true
  2. Ensure the project has an empty .rb file.

  3. Run

    $ rubocop --format html --out results.html

    The following error occurs:

    index 0 outside of array bounds: 0...0
    /home/dev/.rvm/gems/ruby-2.6.6/gems/parser-2.7.1.4/lib/parser/source/buffer.rb:270:in `fetch'
    ...
    
  4. Run

    $ rubocop

    It works as expected.

Environment

$ [bundle exec] rubocop -V
0.90.0 (using Parser 2.7.1.4, rubocop-ast 0.3.0, running on ruby 2.6.6 x86_64-linux)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant