Giter Site home page Giter Site logo

Comments (6)

owst avatar owst commented on August 18, 2024 1

@ohbarye @jeremybdk I was able to reproduce in a simple way:

$ mkdir repro && cd repro
$ git clone [email protected]:reviewdog/action-rubocop.git
Cloning into 'action-rubocop'...
[...]
$ gem install rubocop
Successfully installed rubocop-1.23.0
[...]

$ touch empty_file.rb
$ rubocop empty_file.rb
Inspecting 1 file
W

Offenses:

empty_file.rb:1:1: W: Lint/EmptyFile: Empty file detected.

1 file inspected, 1 offense detected

$ rubocop --require ./action-rubocop/rdjson_formatter/rdjson_formatter.rb --format RdjsonFormatter empty_file.rb
{"source":{"name":"rubocop","url":"https://rubocop.org/"},"diagnostics":[]}
undefined method `begin' for #<RuboCop::Cop::Offense::PseudoSourceRange:0x00007f9dd5949ab0>
Did you mean?  begin_pos
/private/tmp/repro/action-rubocop/rdjson_formatter/rdjson_formatter.rb:41:in `build_diagnostic'
/private/tmp/repro/action-rubocop/rdjson_formatter/rdjson_formatter.rb:19:in `block in file_finished'
/private/tmp/repro/action-rubocop/rdjson_formatter/rdjson_formatter.rb:18:in `each'
/private/tmp/repro/action-rubocop/rdjson_formatter/rdjson_formatter.rb:18:in `file_finished'
[...]

I wonder if rubocop/rubocop#8823 will give any insight to the fix - it sounds like it fixed a (very?) similar issue: rubocop/rubocop#8718

from action-rubocop.

ohbarye avatar ohbarye commented on August 18, 2024 1

Thanks @owst , I figured out the cause. Let me try to fix in #56.

from action-rubocop.

johnofsydney avatar johnofsydney commented on August 18, 2024

I had the same issue and swapped uses: reviewdog/action-rubocop@v2 to uses: reviewdog/action-rubocop@v1

Everything seems to be working ok now

from action-rubocop.

jeremybdk avatar jeremybdk commented on August 18, 2024

I also have the same issue since updating to v2, can I help somehow?

from action-rubocop.

ohbarye avatar ohbarye commented on August 18, 2024

I guess the suggestion feature that is introduced since v2 is related to the error.

line: range.begin.line,
column: range.begin.column + 1 # rubocop is 0-origin, reviewdog is 1-origin

@nononoy @johnofsydney @jeremybdk
Could you give me an example Ruby code to reproduce the error?

from action-rubocop.

jeremybdk avatar jeremybdk commented on August 18, 2024

@ohbarye The thing is I don't really know what's causing this error, as it's always present, is there a way to have more details about the error?

from action-rubocop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.