-
Notifications
You must be signed in to change notification settings - Fork 282
feat: add ty #2137
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
base: main
Are you sure you want to change the base?
feat: add ty #2137
Conversation
| @@ -1 +1 @@ | |||
| version = "pyrefly 0.45.2" | |||
| version = "pyrefly 0.46.0" | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This auto-updated, please let me know if this should be reverted.
| line_to_errors.setdefault(int(lineno), []).append(line) | ||
| return line_to_errors | ||
|
|
||
| class TyTypeChecker(TypeChecker): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is entirely based on the Pyright checker.
| _, lineno, kind, _ = line.split(":", maxsplit=3) | ||
| kind = kind.split()[-1] | ||
| a.add(kind) | ||
| if kind not in ("major", "minor"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we want to re-map these to error and warning but this seems to work fine-ish?
|
|
||
| def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: | ||
| command = [sys.executable, "-m", "ty", "check", ".", "--output-format", "gitlab"] | ||
| proc = run(command, stdout=PIPE, text=True, encoding="utf-8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gitlab seems to be the only json output mode.
836e216 to
d474d74
Compare
|
Thanks, but folk from ty don't yet want to add themselves to the conformance suite |
|
@SimonSchick, are you working with the Astral team on this? Ty is still in prerelease, so I've been waiting for them to give the green light before adding them to the conformance tests. If you have their approval, then great. Otherwise, I think we should hold off on this. |
|
I do not but you are welcome to continue this PR at a later time. |
See https://docs.astral.sh/ty/
I'm uncertain what steps need to be taken to mark tests as unsupported rather than
Unknownin bulk.Should I mark all failing tests as
unsupportedfor the time being?