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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Paalon
Copy link
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
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 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
Collaborator

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
Collaborator

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.

None yet

3 participants