Skip to content

[Not Urgent, Stylistic] Add newlines in long function definitions in src/YAML.jl.#180

Open
Paalon wants to merge 1 commit intoJuliaData:masterfrom
Paalon:refactor-top
Open

[Not Urgent, Stylistic] Add newlines in long function definitions in src/YAML.jl.#180
Paalon wants to merge 1 commit intoJuliaData:masterfrom
Paalon:refactor-top

Conversation

@Paalon
Copy link
Copy Markdown
Contributor

@Paalon Paalon commented Jun 13, 2024

No description provided.

@Paalon Paalon changed the title Add newlines in long function definitions in src/YAML.jl. [Not Urgent, Stylistic] Add newlines in long function definitions in src/YAML.jl. Jun 16, 2024
Copy link
Copy Markdown
Contributor

@GunnarFarneback GunnarFarneback left a comment

Choose a reason for hiding this comment

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

Not a style I like at all, rather the opposite, but I'm not the maintainer.

Comment thread src/YAML.jl
Comment on lines +73 to +82
load(
ts::TokenStream,
more_constructors::_constructor=nothing,
multi_constructors::Dict=Dict();
dicttype::_dicttype=Dict{Any, Any},
constructorType::Function=SafeConstructor,
) = load(
ts,
constructorType(_patch_constructors(more_constructors, dicttype), multi_constructors),
)
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.

Suggested change
load(
ts::TokenStream,
more_constructors::_constructor=nothing,
multi_constructors::Dict=Dict();
dicttype::_dicttype=Dict{Any, Any},
constructorType::Function=SafeConstructor,
) = load(
ts,
constructorType(_patch_constructors(more_constructors, dicttype), multi_constructors),
)
function load(ts::TokenStream, more_constructors::_constructor=nothing, multi_constructors::Dict=Dict();
dicttype::_dicttype=Dict{Any, Any}, constructorType::Function=SafeConstructor)
load(ts, constructorType(_patch_constructors(more_constructors, dicttype), multi_constructors)
end

@kescobo
Copy link
Copy Markdown
Member

kescobo commented Jun 18, 2024

I really dislike this as well. I'd be open to a newline on kwargs or something for these (I showed an example above), but in that case, I think I'd want a function block. This kind of enormous signature strikes me as an abuse of of the short syntax anyway.

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.

3 participants