JuliaIO / ProtoBuf.jl

Julia protobuf implementation
Other
205 stars 55 forks source link

feature: hope add format for generated *_pb.jl #206

Closed zsz00 closed 2 years ago

zsz00 commented 2 years ago

hope add format for generated *_pb.jl

image

Drvi commented 2 years ago

I tried making the generated metadata methods having one field per line, but the files got really long because of that. I think if one wants to read the metadata, they should look at the proto files directly, and use these generated methods only when the need to programmatically access their values.

As a workaround, you can install JuliaFormatter and format the whole output directory of translated julia files.

zsz00 commented 2 years ago

I update the picture : image export ..... too long

ok, I can format the whole output directory *.jl use JuliaFormatter.

Drvi commented 2 years ago

Yeah, for exports it kinda makes sense to have them presented in a readable way... Want to contribute?:) These lines print the export statement: https://github.com/JuliaIO/ProtoBuf.jl/blob/v1.0.2/src/codegen/toplevel_definitions.jl#L180-L185

I think I a case like this we want multiple lines starting with exportkeyword and all of them shorter than 92 characters, a la second example in the Blue Style

zsz00 commented 2 years ago

OK, Let me try do this

zsz00 commented 2 years ago

207

Drvi commented 2 years ago

Closed via #207 and #210