Skip to content

Full YASGuide implementation #198

@ararslan

Description

@ararslan

Here are some (hopefully complete) to-dos to make the experimental YASGuide implementation complete, for whomever wishes to work on it. This is the style guide my company uses, so we'd likely adopt JuliaFormatter if it supported it. This guide has a significant amount of overlap with BlueStyle, so adding the functionality outlined below would also increase the ability to support other popular guides. (Indeed, all but a couple of these apply to both YAS and Blue.)

  • Require ; to separate positional and keyword arguments
  • Rewrite x |> f to f(x)
  • Align line-broken arguments to the parent opening parenthesis (format_text errors for me with function arguments on multiple lines)
  • Require explicit return for returned values in long form function definitions and do blocks
  • Rewrite short form function definitions to long form if the line gets too long
  • Expand and paren-wrap arithmetic in indexing expressions (x[i+1:end] -> x[(i + 1):end])
  • Rewrite import X to using X
  • Rewrite @Module.macro to Module.@macro
  • Annotate unannotated fields in type definitions with ::Any
  • Remove spaces around = in named tuple literals
  • Rewrite function definitions inside of other function definitions to be lambdas

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions