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

Only remove -spec/-type from first line #1894

Merged
merged 1 commit into from
Apr 17, 2024
Merged

Conversation

garazdawi
Copy link
Contributor

Before this change a spec looking like this:

-spec foo(integer()) -> ok;
         (atom()) -> ok.

would be transformed to:

-spec foo(integer()) -> ok;
    (atom()) -> ok.

that is the second clause would be indented incorrectly.

binary_part(line, offset, byte_size(line) - offset)
end)
|> Enum.join("\n")
|> then(&binary_part(&1, offset, byte_size(&1) - offset))
Copy link
Member

Choose a reason for hiding this comment

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

I think we can remove this function then and call String.trim_leading(string, "-type ") instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed I think

Before this change a spec looking like this:

```
-spec foo(integer()) -> ok;
         (atom()) -> ok.
```

would be transformed to:

```
-spec foo(integer()) -> ok;
    (atom()) -> ok.
```

that is the second clause would be indented incorrectly.
@josevalim josevalim merged commit 72bb758 into elixir-lang:main Apr 17, 2024
4 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

@garazdawi garazdawi mentioned this pull request May 10, 2024
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.

2 participants