-
Notifications
You must be signed in to change notification settings - Fork 46
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] Format Julia source files by JuliaFormatter #157
base: master
Are you sure you want to change the base?
Conversation
Does it make sense to (also?) make a precommit hook (I think that's what it's called) so this stays consistent? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm - some of these are definitely appropriate, but I'm not in love with all of them. Then again, I'm not routinely looking at this source code, so it it makes sense for you, I'm ok with it
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), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't love this formatting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. This is the kind of JuliaFormatter thing that makes me not want to touch a code base.
This particular definition shouldn't have been in short form at all though; there's way too many arguments to make that look good, regardless of formatting. Never mind, Juliaformatter makes long form definitions equally horrible.
@@ -80,11 +99,9 @@ done(it::YAMLDocIterator, state) = it.next_doc === nothing | |||
iterate(it::YAMLDocIterator) = next(it, start(it)) | |||
iterate(it::YAMLDocIterator, s) = done(it, s) ? nothing : next(it, s) | |||
|
|||
load_all(input::IO, args...; kwargs...) = | |||
YAMLDocIterator(input, args...; kwargs...) | |||
load_all(input::IO, args...; kwargs...) = YAMLDocIterator(input, args...; kwargs...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This I agree with
Format Julia source files by JuliaFormatter. Everyone can format sources by executing the following in the project root directory:
Formatting styles are set in
.JuliaFormatter.toml
. If there are problems or preferences, tell me.This solves #154.