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

Drop trailing semicolons in block contexts #47

Merged
merged 1 commit into from
Aug 22, 2024
Merged

Conversation

fredrikekre
Copy link
Owner

This patch removes trailing semicolons in blocklike contexts (for, if, ...). Semicolons are left alone in top level contexts since they are sometimes used there for output suppression (e.g. Documenter examples or scripts that are copy-pasted/included in the REPL).

Semicolons before comments are replaced with a single space instead of removed so that if the comments are aligned before, they will be aligned after, for example

begin
    x = 1; # This is x
    y = 2  # This is y
end

will become

begin
    x = 1  # This is x
    y = 2  # This is y
end

This patch removes trailing semicolons in blocklike contexts (`for`,
`if`, ...). Semicolons are left alone in top level contexts since they
are sometimes used there for output suppression (e.g. Documenter
examples or scripts that are copy-pasted/included in the REPL).

Semicolons before comments are replaced with a single space instead of
removed so that if the comments are aligned before, they will be aligned
after, for example
```julia
begin
    x = 1; # This is x
    y = 2  # This is y
end
```
will become
```julia
begin
    x = 1  # This is x
    y = 2  # This is y
end
```
@fredrikekre fredrikekre merged commit d4431f1 into master Aug 22, 2024
14 checks passed
@fredrikekre fredrikekre deleted the fe/semicolons branch August 22, 2024 14:40
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.

1 participant