-
Notifications
You must be signed in to change notification settings - Fork 21
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
Update formatters with changes from OTP 26 #364
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
db4e1f5
elbrujohalcon.otp_formatter.update- Update otp_formatter with changes…
elbrujohalcon 3800fe3
elbrujohalcon.otp_formatter.update- Revert dialyzer change
elbrujohalcon 89297c0
elbrujohalcon.otp_formatter.update- Update deps
elbrujohalcon 8473377
elbrujohalcon.otp_formatter.update- Remove OTP 24 and update rebar3
elbrujohalcon 8ffc18b
elbrujohalcon.otp_formatter.update- Update actions for GH
elbrujohalcon 070fccd
elbrujohalcon.otp_formatter.update- Get all formatters to work on OTP26
elbrujohalcon 80dd875
elbrujohalcon.otp_formatter.update- Reduce code duplication
elbrujohalcon c2e8da8
elbrujohalcon.otp_formatter.update- Allow tests to work with OTP25 an…
elbrujohalcon 420203a
Fix tests… again
elbrujohalcon 97fca07
Adjust tests for OTP26
elbrujohalcon 361bcd2
Add tests for map comprehensions
elbrujohalcon 2954616
Fix test inconsistencies
elbrujohalcon 12dded7
Fix for OTP25
elbrujohalcon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,8 @@ lay_clauses | |
lay_items | ||
old-reliable | ||
otp25 | ||
otp26 | ||
otp27 | ||
paragraph-format | ||
per-file | ||
plugin | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{"1.2.0", | ||
[{<<"katana_code">>,{pkg,<<"katana_code">>,<<"2.1.0">>},0}]}. | ||
[{<<"katana_code">>,{pkg,<<"katana_code">>,<<"2.2.0">>},0}]}. | ||
[ | ||
{pkg_hash,[ | ||
{<<"katana_code">>, <<"0C42BDCD7E59995876AED9F678CF62E3D12EF42E0FBB2190556E64BFEBDD15C6">>}]}, | ||
{<<"katana_code">>, <<"B67EAA70022702AFEC2803E33C89ABE3D817197E7A16246614FED42E03AA8753">>}]}, | ||
{pkg_hash_ext,[ | ||
{<<"katana_code">>, <<"AE3BBACA187511588F69695A9FF22251CB2CC672FDCCC180289779BDD25175EF">>}]} | ||
{<<"katana_code">>, <<"A01F9FDBA838478FDFDE183A324FA12ECE9BA127935065395D01427FC5110CBB">>}]} | ||
]. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
test_app/after/src/inline_qualified_function_composition/function_composition_spaces.erl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
%% @doc New stuff introduced in OTP26. | ||
-module(otp26). | ||
|
||
-export([map_comprehensions/3]). | ||
|
||
map_comprehensions(Map, List, Binary) -> | ||
MapFromList = #{{k, Key} => {value, Value} || Key <- List, Value <- List}, | ||
MapFromBinary = | ||
#{{k, Key} => {value, Value} | ||
|| <<Key/float>> <- Binary, Key >= 8.24551123345, <<Value/binary>> <- Binary}, | ||
MapFromMap = | ||
#{#{key => Key} => [value, Value, is_a_value] | ||
|| {k, Key} := {value, Value} <- MapFromList, is_integer(Key)}, | ||
MapFromCombo = #{Key => binary_to_atom(Value) || Key <- List, <<Value/binary>> <= Binary}, | ||
ListFromMap = | ||
[{Key, Value} | ||
|| {k, Key} := Value <- MapFromBinary, | ||
with:one_filter(Key), | ||
with:another_filter(Value) == <<"a good value">>], | ||
BinaryFromMap = | ||
<< <<Key:64, $|, Value/binary>> | ||
|| #{key := Key} := [value, Value | _] <- MapFromMap, is_binary(Value) >>, | ||
NoGenerator = #{k => v || this:is_true()}, | ||
#{MapFromCombo => ListFromMap, BinaryFromMap => NoGenerator}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
-module(strings). | ||
|
||
-export([heredoc/0]). | ||
|
||
-format #{inline_expressions => true}. | ||
|
||
heredoc() -> | ||
{ok, | ||
"" " | ||
This is | ||
a multiline | ||
heredoc but there are | ||
no multiline heredocs in Erlang :'( | ||
" | ||
""}. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 and other similar changes are due to a subtle bug (fixed in OTP26's
erl_syntax
) that reordered map items when they were found in attributes. I decided to just put the items in the order in whicherl_syntax
returns them (thus, hiding the bug in OTP25) so that tests run seamlessly in 25 and 26.