Skip to content

Add normalize_bitstring_modifiers option to formatter#11840

Merged
whatyouhide merged 4 commits intoelixir-lang:mainfrom
sabiwara:11811-formatter-bitstring-mod
May 17, 2022
Merged

Add normalize_bitstring_modifiers option to formatter#11840
whatyouhide merged 4 commits intoelixir-lang:mainfrom
sabiwara:11811-formatter-bitstring-mod

Conversation

@sabiwara
Copy link
Copy Markdown
Contributor

Hi,

This PR adds a normalize_bitstring_modifiers boolean option as specified as #11811. Hope it helps.

I'm happy to keep working on this issue and add enforce_calls_on_right_hand_side_of in an upcoming PR if nobody is working on this.

@sabiwara sabiwara force-pushed the 11811-formatter-bitstring-mod branch from 49d553d to 8352153 Compare May 16, 2022 14:43
Copy link
Copy Markdown
Member

@whatyouhide whatyouhide left a comment

Choose a reason for hiding this comment

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

This looks fantastic! Left just a couple of comments.

Comment thread lib/elixir/lib/code/formatter.ex Outdated
state = %{normalize_bitstring_modifiers: true}
)
when is_atom(atom) and empty_args in [nil, []] do
empty_args = bitstring_spec_notmalized_empty_args(atom)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Typo in this function name 🙃

Suggested change
empty_args = bitstring_spec_notmalized_empty_args(atom)
empty_args = bitstring_spec_normalized_empty_args(atom)

Needs to be updated below too.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Woops, thank you 😅 Fixed

Comment thread lib/elixir/lib/code.ex Outdated
Comment thread lib/elixir/lib/code.ex
Copy link
Copy Markdown
Member

@josevalim josevalim left a comment

Choose a reason for hiding this comment

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

Beautiful work, just some minor comments. :)

sabiwara and others added 3 commits May 17, 2022 07:41
Co-authored-by: Andrea Leopardi <an.leopardi@gmail.com>
Co-authored-by: José Valim <jose.valim@gmail.com>
@sabiwara
Copy link
Copy Markdown
Contributor Author

@whatyouhide @josevalim thank you for the reviews!
I addressed the comments.

@whatyouhide whatyouhide merged commit 7b70999 into elixir-lang:main May 17, 2022
@whatyouhide
Copy link
Copy Markdown
Member

Thanks @sabiwara! 💟

@whatyouhide
Copy link
Copy Markdown
Member

I'm happy to keep working on this issue and add enforce_calls_on_right_hand_side_of in an upcoming PR if nobody is working on this.

@sabiwara go ahead, I don't think anyone has picked it up yet 🙃

@sabiwara sabiwara deleted the 11811-formatter-bitstring-mod branch May 17, 2022 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants