4 ms·
> pyrefly check --suppress-errors > INFO 5,240 errors shown, 65,932 errors ignored Not a single Python type checker had ever worked for me so far.
by koakuma-chan 2y ago
> pyrefly check --suppress-errors
> INFO 5,240 errors shown, 65,932 errors ignored
Not a single Python type checker had ever worked for me so far.
- kstrauser 2y agoI don't see the link between that output and your conclusion. Are those results wrong?
- koakuma-chan 2y ago> Are those results wrong? I don't know. Some packages just don't work with type checkers, e.g. Django.
- masklinn 2y agoDjango has a community stubs project, are you using it?
- etimberg 2y agothe stubs can only do so much. There's so much magic and inferred properties that a type checker will never be able to fill in alone
- aitchnyu 2y agoDoes django-stubs work with other type checkers than Pyright?
- masklinn 2y agoStubs are a standard python feature (PEP 561) so I'd expect them to work with any type checker which supports stubs, which should be all of them (as much of the ecosystem is typed via stubs).
- johnisgood 2y agoIs it not that he used the "--suppress-errors" flag yet it did not ignore the errors?
- kstrauser 2y agoIt's hard to tell. Other similar options in other commands can mean things like "exit with status 0 even if errors are detected". Without installing pyrefly, I'm not sure what that flag's supposed to do. It's not documented on their site.
- koakuma-chan 2y agoIt adds a comment to suppress the error above each line in your codebase that causes an error, but it reports the errors before doing that, so you can only see the result after you re-run `pyrefly check`.
- kstrauser 2y agoOh! That's nifty. It leaves you with a baseline so you can stop making new mistakes, and gives you something to grep for when you want to fix existing ones.
- ipsum2 2y agoIt's literally working? What did you expect?
- koakuma-chan 2y agoMaybe it's working but it's not useful.
- masklinn 2y agoWhat would you expect "useful" to be if your codebase is basically incompatible with type checking?
- koakuma-chan 2y agoI expected that I would be able to run the check command and it would just work. Upon reading the docs, this tool recommends incremental adoption, and after using `--suppress-errors`, `# pyrefly: ignore` is all over my codebase.
- Yossarrian22 2y ago…how else would it work?
- nerdponx 2y agoThat's incremental adoption for adding type hints, not for adopting this particular tool in an already-type-hinted codebase.
- krick 2y agoI know I shouldn't get into this thread, but I'm extremely curious: what did you expect should have happened? I mean, literally, what do you mean by "just work", what work did you expect a type checker to perform if not to show you errors?
- koakuma-chan 2y ago
- ForHackernews 2y agoFix your types.
- IshKebab 2y agoDo you... have type annotations? I think you might be missing the point.
- jon-wood 2y agoI think the point here is that for something like Python the default behaviour should be an assumed return type of `Any` rather than throwing an error. Maybe that is the case and the GP had configured it otherwise.
- IshKebab 2y agoNo it shouldn't because then you can easily miss places where you should have added a type annotation, and also your lazy colleagues won't bother adding them at all.
- darthrupert 2y agoThe worst of both worlds is colleagues who insert type annotations but they're wrong. And there's no CI pipe to verify the types before check-in. Working with these things makes me often think that people who want to write high quality software should just use a better language. But, well, real world is real.
- koakuma-chan 2y ago> just use a better language This
- IshKebab 2y agoYeah unfortunately Python is crazy popular so a lot of the time you don't get a choice. If fairness if you set up uv and Ruff and Pyright it's kind of ok. Still have to deal with the general noobness of the ecosystem and the horrific performance, but I've seen worse.
- team_pyrefly 2y agoThanks for giving this a try! We go over how to use the upgrade tooling (`--suppress-errors`) in the guide here: https://pyrefly.org/en/docs/installation/ https://pyrefly.org/en/docs/installation/. This is intended to make upgrading from different versions of type checkers easier. It’s something we use internally and wanted to share with the community along with the checker itself. We also allow you the ability to suppress whole classes of errors if you want to ignore specific error types and avoid inline ignores: https://pyrefly.org/en/docs/configuration/ https://pyrefly.org/en/docs/configuration/ A word of caution: this will ignore future errors of this type as well. First, make sure your project is properly configured and then follow the instructions. `--suppress-errors` will add ignores inline allowing the project to check cleanly. We have thought about a feature that allows you to keep suppressions in a separate file, but we have not put it on the roadmap yet. If this is something important for your workflow, we would like to learn more - please add a feature request on GitHub.
- darthrupert 2y agoDon't blame the tool for your shoddy work. Either accept your mediocre quality or do something to fix it.