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

The linter panicked unexpectedly #30

Closed
brandly opened this issue Oct 5, 2020 · 11 comments
Closed

The linter panicked unexpectedly #30

brandly opened this issue Oct 5, 2020 · 11 comments
Labels
A-error-recovery Area: Error recovery for the parser ILE (Internal Linter Error) A panic from the linter T-Lexer This issue primary relates to rslint_lexer T-Parser This issue primarily relates to rslint_parser

Comments

@brandly
Copy link

brandly commented Oct 5, 2020

hi! i saw your post on r/rust. i write a lot of typescript, but tried running this on some plain JS.

i ran it on this file and was told everything's good:

$ rslint_cli index.js

Outcome: 0 fail, 0 warn, 1 success

i wanted to run it on this project, but i ran into an unexpected panic.

$ rslint_cli 'src/*.js' 
error[]: The linter panicked unexpectedly. this is a bug.

We would appreciate a bug report: https://github.com/RDambrosio016/RSLint/issues/new?labels=ILE%2C+bug&template=internal-linter-error.md

note[]: Please include the following info: 

message: 
location: /Users/brandly/.cargo/registry/src/github.com-1ecc6299db9ec823/rslint_parser-0.1.2/src/parser.rs:158:9

i'm wrapping the glob in quotes because i'm on zsh, and it'll expand the glob otherwise e.g.:

$ rslint_cli src/*.js  
error: Found argument 'src/api.test.js' which wasn't expected, or isn't valid in this context

USAGE:
    rslint_cli [FLAGS] [files] [SUBCOMMAND]

For more information try --help

if i'm running this incorrectly, the feedback could be improved. otherwise, something might be broken.

thanks again. i'm looking forward to fast JS tooling.

@brandly brandly added the ILE (Internal Linter Error) A panic from the linter label Oct 5, 2020
@RDambrosio016
Copy link
Collaborator

RDambrosio016 commented Oct 5, 2020

Thank you for the bug report!

Im still not sure why the message is not included for that but yknow, weird rust panic info logic, but thats the parser infinitely recursing, which is usually because of:

  • Bad error recovery
  • Bad parsing

I will take a look and update you once i find/fix it 🙂

@RDambrosio016 RDambrosio016 added the T-Parser This issue primarily relates to rslint_parser label Oct 5, 2020
@RDambrosio016
Copy link
Collaborator

Oh nevermind, the issue is the unicode character which i did not notice, like let foo = { α: true }. The lexer makes it an error token and the parser has a hard time recovering from there. I think this is a lexer issue since if i am not mistaken that is an allowed char for identifiers

@RDambrosio016 RDambrosio016 added T-Lexer This issue primary relates to rslint_lexer and removed T-Parser This issue primarily relates to rslint_parser labels Oct 5, 2020
@RDambrosio016
Copy link
Collaborator

This also brings to light the issue of error tokens in literal properties causing infinite recursion, which is an error recovery problem. Thank you for finding 2 bugs! 😄

@RDambrosio016 RDambrosio016 added A-error-recovery Area: Error recovery for the parser T-Parser This issue primarily relates to rslint_parser labels Oct 5, 2020
@RDambrosio016
Copy link
Collaborator

Lexer issue fixed in d0dbbe9
Parser issue has not been fixed yet

@RDambrosio016
Copy link
Collaborator

Fixed in 77a7ea6

@brandly
Copy link
Author

brandly commented Oct 6, 2020

i pulled master to the latest (f6f4cef), ran cargo install rslint_cli --force, and i still see the same thing:

$ rslint_cli 'src/*.js'
error[]: The linter panicked unexpectedly. this is a bug.

We would appreciate a bug report: https://github.com/RDambrosio016/RSLint/issues/new?labels=ILE%2C+bug&template=internal-linter-error.md

note[]: Please include the following info: 

message: 
location: /Users/brandly/.cargo/registry/src/github.com-1ecc6299db9ec823/rslint_parser-0.1.2/src/parser.rs:158:9

am i doing something wrong?

@RDambrosio016
Copy link
Collaborator

cargo install would be pulling from crates.io, and the fixes are on an unreleased version

@RDambrosio016
Copy link
Collaborator

Other than a lot of imports spam it works for me if i use cargo run

@RDambrosio016
Copy link
Collaborator

@brandly i published new versions, it should work now if you install again

@brandly
Copy link
Author

brandly commented Oct 6, 2020

thanks!

Other than a lot of imports spam it works for me if i use cargo run

you're right! this worked on my end too.

cargo install would be pulling from crates.io

i was thinking the cargo install command was just building the local package and moving it to my PATH, similar to a stack install. makes sense tho!

@RDambrosio016
Copy link
Collaborator

cargo install --path rslint_cli can do that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-error-recovery Area: Error recovery for the parser ILE (Internal Linter Error) A panic from the linter T-Lexer This issue primary relates to rslint_lexer T-Parser This issue primarily relates to rslint_parser
Projects
None yet
Development

No branches or pull requests

2 participants