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

Fix all remaining self-check errors #521

Merged
merged 18 commits into from
Mar 16, 2023

Conversation

erszcz
Copy link
Collaborator

@erszcz erszcz commented Mar 14, 2023

Down to 37 lines so far 🎉

@erszcz
Copy link
Collaborator Author

erszcz commented Mar 14, 2023

15 lines, but we get a failure in property based tests :|

@erszcz erszcz force-pushed the fix-more-self-check-errors branch from 431c1ac to 4bb2da4 Compare March 15, 2023 08:10
@erszcz erszcz force-pushed the fix-more-self-check-errors branch 2 times, most recently from 30f7c8f to da2a4fd Compare March 15, 2023 09:08
@erszcz erszcz changed the title Fix more self check errors Fix all remaining self check errors Mar 15, 2023
@erszcz
Copy link
Collaborator Author

erszcz commented Mar 15, 2023

Gradualizer can now self-check with no warnings emitted! 🎉

@erszcz erszcz marked this pull request as ready for review March 15, 2023 09:11
@erszcz erszcz changed the title Fix all remaining self check errors Fix all remaining self-check errors Mar 15, 2023
Copy link
Collaborator

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@@ -90,7 +90,7 @@ bin/gradualizer: $(beams) ebin/gradualizer.app

.PHONY: gradualize
gradualize: escript
bin/gradualizer --infer --solve_constraints --specs_override_dir priv/extra_specs/ \
@bin/gradualizer --infer --solve_constraints --specs_override_dir priv/extra_specs/ \
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't want the user to see which command we're running?

Copy link
Collaborator Author

@erszcz erszcz Mar 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's connected with how we count lines in the CI self-check assessment (see changes to .github/workflows/self-check.yml in this PR). We cannot rely on the status code, because we ignore some trivial errors with grep -v and the status code always reflects failure. We check the number of error lines instead. If we print the command, we have to assume that exactly 2 lines means "no errors", which is a bit strange. If we do not print the command, 0 error lines means "no errors", i.e. a success.

All in all, it's a detail. The user can still see the command in the Makefile.

src/gradualizer_lib.erl Show resolved Hide resolved
src/gradualizer_type.erl Show resolved Hide resolved
src/typechecker.erl Outdated Show resolved Hide resolved
@erszcz erszcz force-pushed the fix-more-self-check-errors branch from da2a4fd to 3e31239 Compare March 15, 2023 14:22
@erszcz erszcz merged commit ef88277 into josefs:master Mar 16, 2023
@erszcz erszcz deleted the fix-more-self-check-errors branch March 16, 2023 21:37
@zuiderkwast
Copy link
Collaborator

Nice!

erszcz added a commit to erszcz/erlang_ls that referenced this pull request Jun 16, 2023
This version brings approx. 30 new PRs. The highlights are:

- Improve map exhaustiveness checking [erlang-ls#524](josefs/Gradualizer#524) by @xxdavid
- Fix all remaining self-check errors [erlang-ls#521](josefs/Gradualizer#521) by @erszcz
- Fix intersection-typed function calls with union-typed arguments [erlang-ls#514](josefs/Gradualizer#514) by @erszcz
- Experimental constraint solver [erlang-ls#450](josefs/Gradualizer#450) by @erszcz
erszcz added a commit to erszcz/erlang_ls that referenced this pull request Jun 16, 2023
This version brings approx. 30 PRs. The highlights are:

- Improve map exhaustiveness checking [erlang-ls#524](josefs/Gradualizer#524) by @xxdavid
- Fix all remaining self-check errors [erlang-ls#521](josefs/Gradualizer#521) by @erszcz
- Fix intersection-typed function calls with union-typed arguments [erlang-ls#514](josefs/Gradualizer#514) by @erszcz
- Experimental constraint solver [erlang-ls#450](josefs/Gradualizer#450) by @erszcz
erszcz added a commit to erszcz/erlang_ls that referenced this pull request Jun 16, 2023
This version brings approx. 30 PRs. The highlights are:

- Improve map exhaustiveness checking [erlang-ls#524](josefs/Gradualizer#524) by @xxdavid
- Fix all remaining self-check errors [erlang-ls#521](josefs/Gradualizer#521) by @erszcz
- Fix intersection-typed function calls with union-typed arguments [erlang-ls#514](josefs/Gradualizer#514) by @erszcz
- Experimental constraint solver [erlang-ls#450](josefs/Gradualizer#450) by @erszcz
robertoaloi pushed a commit to erlang-ls/erlang_ls that referenced this pull request Jun 17, 2023
This version brings approx. 30 PRs. The highlights are:

- Improve map exhaustiveness checking [#524](josefs/Gradualizer#524) by @xxdavid
- Fix all remaining self-check errors [#521](josefs/Gradualizer#521) by @erszcz
- Fix intersection-typed function calls with union-typed arguments [#514](josefs/Gradualizer#514) by @erszcz
- Experimental constraint solver [#450](josefs/Gradualizer#450) by @erszcz
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 this pull request may close these issues.

None yet

2 participants