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

steep:ignore family sometimes doesn’t work in CRLF files #1376

Open
ParadoxV5 opened this issue Dec 2, 2024 · 0 comments · May be fixed by #1406
Open

steep:ignore family sometimes doesn’t work in CRLF files #1376

ParadoxV5 opened this issue Dec 2, 2024 · 0 comments · May be fixed by #1406

Comments

@ParadoxV5
Copy link
Contributor

$ echo -e '\r\nfoo # steep:ignore' > ruby.rb
$ hexdump *
0000000 0a0d 6f66 206f 2023 7473 6565 3a70 6769
0000010 6f6e 6572 000a
0000015
$ steep check
2024-12-02 16:35:47.772: ERROR: [Steep 1.8.3] Cannot find a configuration at Steepfile: `steep init` to scaffold. Using current directory...
# Type checking files:

...........................................................F........................

ruby.rb:2:0: [error] Type `::Object` does not have method `foo`
│ Diagnostic ID: Ruby::NoMethod

└ foo # steep:ignore
  ~~~

Detected 1 problem from 1 file
@ParadoxV5 ParadoxV5 moved this to 🔜 To Do in General Projects Dec 2, 2024
tk0miya added a commit to tk0miya/steep that referenced this issue Dec 13, 2024
parser gem removes CR characters before parsing.  Therefore `Parser::
Source::Buffer` does not contain any CR characters.  As a result,
`Parser::Source::Comment` points the location without CR characters.

On the other hand, `RBS::Buffer` contains CR characters.  This
difference causes `steep:ignore` comment disabled.

This converts the location of comments using line and column

Close soutaro#1376
@tk0miya tk0miya linked a pull request Dec 13, 2024 that will close this issue
@ParadoxV5 ParadoxV5 moved this from 🔜 To Do to 🗳️ Submitted in General Projects Dec 13, 2024
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