Skip to content

Commit cad344f

Browse files
authored
Merge pull request #493 from erszcz/release-0.2.0
Release 0.2.0
2 parents 47c8b58 + 3e98c72 commit cad344f

File tree

6 files changed

+155
-42
lines changed

6 files changed

+155
-42
lines changed

.github/workflows/publish-to-hex.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
# Gradualizer Changelog
2+
3+
Changelog generated with [`github-changelog`](https://github.com/cfpb/github-changelog),
4+
the following command for each pair of tags, and a bit of manual editing:
5+
6+
```
7+
changelog -m --branch master josefs gradualizer 0.1.3 0.2.0 >> CHANGELOG.md
8+
```
9+
10+
11+
## 2022-12-02 - [0.2.0](https://github.com/josefs/Gradualizer/compare/0.1.3...0.2.0)
12+
13+
Release highlights:
14+
15+
- Use ExDoc [#456](https://github.com/josefs/gradualizer/pull/456)
16+
- Function intersections [#461](https://github.com/josefs/gradualizer/pull/461)
17+
- Fix more infinite loops [#458](https://github.com/josefs/gradualizer/pull/458)
18+
- Add `gradualizer_tracer` for efficient troubleshooting [#454](https://github.com/josefs/gradualizer/pull/454)
19+
- Enable Dialyzer and ETC cross checks [#429](https://github.com/josefs/gradualizer/pull/429)
20+
- Fix some self-gradualization errors [#408](https://github.com/josefs/gradualizer/pull/408)
21+
- Point README at [Gradient](https://github.com/esl/gradient) instead of discontinued Gradualixir [#396](https://github.com/josefs/gradualizer/pull/396)
22+
- Property based tests to find bugs [#363](https://github.com/josefs/gradualizer/pull/363)
23+
- Add a GitHub Actions CI workflow [#343](https://github.com/josefs/gradualizer/pull/343)
24+
- Non-trivial sum type exhaustiveness checking [#330](https://github.com/josefs/gradualizer/pull/330)
25+
26+
Full list of merged PRs:
27+
28+
- Add known problem for unsupported maybe expression [#489](https://github.com/josefs/gradualizer/pull/489)
29+
- Override filename specs [#487](https://github.com/josefs/gradualizer/pull/487)
30+
- Use ExDoc [#456](https://github.com/josefs/gradualizer/pull/456)
31+
- Define some shell utils for interactive work with Gradualizer [#455](https://github.com/josefs/gradualizer/pull/455)
32+
- Move test from `test/known_problems/should_pass/intersection.erl` to `test/should_pass/intersection_pass.erl` [#486](https://github.com/josefs/gradualizer/pull/486)
33+
- Expand `erlang:'++'` function specs [#485](https://github.com/josefs/gradualizer/pull/485)
34+
- Function intersections [#461](https://github.com/josefs/gradualizer/pull/461)
35+
- fix GitHub reference in rebar3 example README [#482](https://github.com/josefs/gradualizer/pull/482)
36+
- Override the spec of `erlang:error/3` too [#481](https://github.com/josefs/gradualizer/pull/481)
37+
- Fix `erlang:error/2` spec [#478](https://github.com/josefs/gradualizer/pull/478)
38+
- add xref ignores to header file defining `::`/`:::` [#475](https://github.com/josefs/gradualizer/pull/475)
39+
- Expand user types in record unions [#469](https://github.com/josefs/gradualizer/pull/469)
40+
- Handle `non_neg_integer() + pos_integer() :: pos_integer()` properly [#465](https://github.com/josefs/gradualizer/pull/465)
41+
- Fix integer user type alias [#463](https://github.com/josefs/gradualizer/pull/463)
42+
- Add `install-asdf` rule to Makefile [#459](https://github.com/josefs/gradualizer/pull/459)
43+
- Housekeeping [#460](https://github.com/josefs/gradualizer/pull/460)
44+
- Fix more infinite loops [#458](https://github.com/josefs/gradualizer/pull/458)
45+
- Fix map type inference [#457](https://github.com/josefs/gradualizer/pull/457)
46+
- Add `gradualizer_tracer` for efficient troubleshooting [#454](https://github.com/josefs/gradualizer/pull/454)
47+
- Housekeeping [#453](https://github.com/josefs/gradualizer/pull/453)
48+
- Fix some infinite loops [#452](https://github.com/josefs/gradualizer/pull/452)
49+
- Fix crash when a record union contains `any()` [#447](https://github.com/josefs/gradualizer/pull/447)
50+
- `merge_with` in OTP 24! [#335](https://github.com/josefs/gradualizer/pull/335)
51+
- Add specs for `++/2` and `--/2` [#440](https://github.com/josefs/gradualizer/pull/440)
52+
- Propagate var binds across list comprehension filters [#444](https://github.com/josefs/gradualizer/pull/444)
53+
- Remove `.envrc` [#443](https://github.com/josefs/gradualizer/pull/443)
54+
- Fix more self check errors [#441](https://github.com/josefs/gradualizer/pull/441)
55+
- Fix `gradualizer_int:int_type_to_range/1` crash [#439](https://github.com/josefs/gradualizer/pull/439)
56+
- Fix record field access type check crash [#436](https://github.com/josefs/gradualizer/pull/436)
57+
- Add examples of list comprehension generators being `none()` [#434](https://github.com/josefs/gradualizer/pull/434)
58+
- Export function in tests to fix a Dialyzer error [#431](https://github.com/josefs/gradualizer/pull/431)
59+
- Fix Dialyzer warning in tests [#430](https://github.com/josefs/gradualizer/pull/430)
60+
- Enable Dialyzer and ETC cross checks [#429](https://github.com/josefs/gradualizer/pull/429)
61+
- Another batch of type error fixes [#427](https://github.com/josefs/gradualizer/pull/427)
62+
- Simplify `refinable(#{})` [#424](https://github.com/josefs/gradualizer/pull/424)
63+
- Make an empty `map()` refinable [#420](https://github.com/josefs/gradualizer/pull/420)
64+
- Make `binary()`, aka `String.t()` in Elixir, refinable [#392](https://github.com/josefs/gradualizer/pull/392)
65+
- Fix false nonexhaustive record patterns warning [#419](https://github.com/josefs/gradualizer/pull/419)
66+
- Fix some self-gradualization errors [#408](https://github.com/josefs/gradualizer/pull/408)
67+
- Redefine `top()` to `none()` to clean up remaining compilation warnings [#402](https://github.com/josefs/gradualizer/pull/402)
68+
- Always throw `call_undef` with raw module, function, and arity [#415](https://github.com/josefs/gradualizer/pull/415)
69+
- Fix list exhaustiveness checking regressions [#404](https://github.com/josefs/gradualizer/pull/404)
70+
- Salvage exhaustiveness checking improvements [#403](https://github.com/josefs/gradualizer/pull/403)
71+
- Check exhaustiveness argument-wise [#391](https://github.com/josefs/gradualizer/pull/391)
72+
- Point README at [Gradient](https://github.com/esl/gradient) instead of discontinued Gradualixir [#396](https://github.com/josefs/gradualizer/pull/396)
73+
- Fix variable bind before a record pattern match in function head [#397](https://github.com/josefs/gradualizer/pull/397)
74+
- Fix `pp_type({var, ..., _})` [#401](https://github.com/josefs/gradualizer/pull/401)
75+
- Fix for map pattern "doesn't have type any()" warning [#389](https://github.com/josefs/gradualizer/pull/389)
76+
- Temporary measure: break cycles by timing out [#383](https://github.com/josefs/gradualizer/pull/383)
77+
- Recover position information for `undef`/`not_exported` type errors [#384](https://github.com/josefs/gradualizer/pull/384)
78+
- Provide the git commit sha when asked for `--version` in CLI [#385](https://github.com/josefs/gradualizer/pull/385)
79+
- Fix typos [#377](https://github.com/josefs/gradualizer/pull/377)
80+
- Call `remove_pos` only where a type comes into the system [#375](https://github.com/josefs/gradualizer/pull/375)
81+
- Property based tests to find bugs [#363](https://github.com/josefs/gradualizer/pull/363)
82+
- Allow giving include path to erl files imported into db [#344](https://github.com/josefs/gradualizer/pull/344)
83+
- Add a GitHub Actions CI workflow [#343](https://github.com/josefs/gradualizer/pull/343)
84+
- Non-trivial sum type exhaustiveness checking [#330](https://github.com/josefs/gradualizer/pull/330)
85+
- Extract type env from typechecker.erl and convert it to a map [#333](https://github.com/josefs/gradualizer/pull/333)
86+
87+
88+
## 2021-02-18 - [0.1.3](https://github.com/josefs/Gradualizer/compare/0.1.2...0.1.3)
89+
90+
- Record update missing fields fix [#314](https://github.com/josefs/gradualizer/pull/314)
91+
- Any type fix within complex patterns [#315](https://github.com/josefs/gradualizer/pull/315)
92+
- should_fail/intersection_with_any - one more example [#305](https://github.com/josefs/gradualizer/pull/305)
93+
- Compile test data before gradualizing [#303](https://github.com/josefs/gradualizer/pull/303)
94+
95+
96+
## 2020-11-06 - [0.1.2](https://github.com/josefs/Gradualizer/compare/0.1.1...0.1.2)
97+
98+
- Expand dirs in rebar so exclusion works [#296](https://github.com/josefs/gradualizer/pull/296)
99+
100+
101+
## 2020-11-02 - [0.1.1](https://github.com/josefs/Gradualizer/compare/0.1.0...0.1.1)
102+
103+
- Warning and shadowing [#293](https://github.com/josefs/gradualizer/pull/293)
104+
105+
106+
## 2020-10-19 - [0.1.0](https://github.com/josefs/Gradualizer/compare/0.0.0...0.1.0)
107+
108+
- Record refinement [#271](https://github.com/josefs/gradualizer/pull/271)
109+
- Bit syntax integer signedness [#283](https://github.com/josefs/gradualizer/pull/283)
110+
- More tests for opaque types [#277](https://github.com/josefs/gradualizer/pull/277)
111+
- Allow type refinement in the presence of matching opaque types. [#276](https://github.com/josefs/gradualizer/pull/276)
112+
- Increase coverage [#260](https://github.com/josefs/gradualizer/pull/260)
113+
- Normalize annotated types [#228](https://github.com/josefs/gradualizer/pull/228)
114+
- Returning incorrectly typed map should fail [#238](https://github.com/josefs/gradualizer/pull/238)
115+
- Accept var in update_map_type [#237](https://github.com/josefs/gradualizer/pull/237)
116+
- Add failing named_record_arg/1 test [#225](https://github.com/josefs/gradualizer/pull/225)
117+
- Fix broken CLI features and add CLI tests [#189](https://github.com/josefs/gradualizer/pull/189)

README.md

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,11 @@ It does so by
2323
When type specs are added the program is checked against
2424
these specs statically. The more type specs, the more static typing.
2525

26-
An example is worth more than a thousand words:
26+
A picture is worth more than a thousand words:
2727

28-
```erlang
29-
1 -module(exhaustive_type).
30-
2
31-
3 -export([allergen_score/1]).
32-
4
33-
5 -type allergen() :: eggs
34-
6 | chocolate
35-
7 | pollen
36-
8 | cats.
37-
9
38-
10 -spec allergen_score(allergen()) -> integer().
39-
11 allergen_score(Al) ->
40-
12 case Al of
41-
13 eggs -> 1;
42-
14 chocolate -> 32;
43-
15 pollen -> 64
44-
16 end.
45-
```
28+
[![](screenshots/exhaustive_type.png) ![](doc/screenshots/exhaustive_type.png)][examples]
4629

47-
```
48-
$ gradualizer test/should_fail/exhaustive_type.erl
49-
test/should_fail/exhaustive_type.erl: Nonexhaustive patterns on line 13 at column 9
50-
Example values which are not covered:
51-
cats
52-
```
30+
[examples]: https://github.com/erszcz/Gradualizer/blob/release-0.2.0/doc/examples.md
5331

5432

5533
## Usage

doc/examples.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Some examples of Gradualizer in action
2+
3+
![An example Gradualizer exhaustiveness checking diagnostic](screenshots/exhaustive_type.png)
4+
5+
Here's the same example in text for copy-pasting:
6+
7+
```erlang
8+
1 -module(exhaustive_type).
9+
2
10+
3 -export([allergen_score/1]).
11+
4
12+
5 -type allergen() :: eggs
13+
6 | chocolate
14+
7 | pollen
15+
8 | cats.
16+
9
17+
10 -spec allergen_score(allergen()) -> integer().
18+
11 allergen_score(Al) ->
19+
12 case Al of
20+
13 eggs -> 1;
21+
14 chocolate -> 32;
22+
15 pollen -> 64
23+
16 end.
24+
```
25+
26+
```
27+
$ gradualizer test/should_fail/exhaustive_type.erl
28+
test/should_fail/exhaustive_type.erl: Nonexhaustive patterns on line 13 at column 9
29+
Example values which are not covered:
30+
cats
31+
```
32+
33+
[ErlangLS](https://github.com/erlang-ls/erlang_ls) integration example:
34+
35+
![Gradualizer diagnostics with ErlangLS](screenshots/134913123-4700b299-2714-4227-b7e2-f8c816b138a5.gif)
Loading

doc/screenshots/exhaustive_type.png

216 KB
Loading

0 commit comments

Comments
 (0)