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

Implements YASGuide style #217

Merged
merged 20 commits into from
Apr 8, 2020
Merged

Implements YASGuide style #217

merged 20 commits into from
Apr 8, 2020

Conversation

domluna
Copy link
Owner

@domluna domluna commented Apr 8, 2020

cleaned up #214

domluna added 20 commits April 7, 2020 21:29
- import_to_using = false
- pipe_to_function_call = false
- short_to_long_function_def = false
- always_use_return = false

If true `import` expressions are rewritten to `using` expressions
in the following cases:

```julia
import A
import A, B, C
```

is rewritten to:

```julia
using A: A
using A: A
using B: B
using C: C
```

If true `f |> x` is rewritten to `f(x)`.

Transforms a _short_ function definition

```julia
f(arg1, arg2) = body
```

to a _long_ function definition

```julia
function f(arg2, arg2)
    body
end
```

If true `return` will be prepended to the last expression where
applicable in function definitions, macro definitions, and do blocks.

Example:

```julia
function foo()
    expr1
    expr2
end
```

to

```julia
function foo()
    expr1
    return expr2
end
```
Additionally:

- more docs
- more utility functions
`@` is now moved to the final identifier in the call
chain of a macro call.
```julia
struct Foo
    field
end
```

->

```julia
struct Foo
    field::Any
end
```
- `walk` over a FST[]
- `nest_if_over_margin` (used by YASStyle)
```
Call[arg1, arg2, Paramters[arg3, arg4]]
```

->

```
Call[arg1, arg2, arg3, arg4]
```

Update nesting to account for that.
@domluna domluna merged commit a081553 into master Apr 8, 2020
@nickrobinson251 nickrobinson251 mentioned this pull request Sep 5, 2020
36 tasks
@domluna domluna deleted the yasguide branch September 24, 2020 21:27
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