Skip to content

Adds offset '1', because pyrights offsets are zero-based (issue #25) #26

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

Merged
merged 6 commits into from
Mar 24, 2022
Merged

Conversation

gersmann
Copy link
Contributor

No description provided.

@jordemort
Copy link
Owner

Thanks for the fix! I checked out this branch and poked at it a bit. Based on pyright's output, and on the response to the issue you linked in the pyright repo, I think the column numbers are 0-based as well, and we need to bump those also.

Here's a raw diagnostic from pyright running on bad.py:

        {
            "file": "/home/jordan/Source/action-pyright/pyright_to_rdjson/tests/files/bad.py",
            "severity": "error",
            "message": "Operator \"+\" not supported for types \"str\" and \"int\"\n  Operator \"+\" not supported for types \"str\" and \"int\"",
            "range": {
                "start": {
                    "line": 1,
                    "character": 11
                },
                "end": {
                    "line": 1,
                    "character": 20
                }
            },
            "rule": "reportGeneralTypeIssues"
        },

Here's the line it's referring to:

    return one + two + three

If you assume character is zero-based, then the string it calls out is one + two.

If you assume character is one-based, then the string it calls out is one + tw.

According to the Reviewdog JSON Schema, their positions are one-based: https://github.com/reviewdog/reviewdog/blob/master/proto/rdf/jsonschema/Position.jsonschema

gersmann and others added 4 commits March 24, 2022 21:00
Co-authored-by: Jordan Webb <jordan@caketop.app>
Co-authored-by: Jordan Webb <jordan@caketop.app>
Co-authored-by: Jordan Webb <jordan@caketop.app>
Co-authored-by: Jordan Webb <jordan@caketop.app>
@gersmann
Copy link
Contributor Author

makes sense, thanks for checking this out

@jordemort jordemort merged commit a72509b into jordemort:main Mar 24, 2022
@jordemort
Copy link
Owner

Merged, thanks!

@github-actions
Copy link
Contributor

🚀 [bumpr] Bumped! New version:v1.6.0 Changes:v1.5.0...v1.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants