Drvi / ProtocolBuffers.jl

4 stars 0 forks source link

Add `add_kwarg_constructors` option & default value tests #6

Closed Drvi closed 2 years ago

Drvi commented 2 years ago

To make transitions from current ProtoBuf.jl a little easier, the add_kwarg_constructors flag can be set to generate kwarg only constructors for the generated structs. The keyword arguments are optional with the exception of required message-fields which have no default value.

The default_values metadata method is also a bit more helpful now as it returns the actual default values and not the "initial" values used for decoding, i.e. it returns Vectors instead of our BufferedVectors etc.)

codecov-commenter commented 2 years ago

Codecov Report

Merging #6 (aedc07b) into master (caa3cf5) will increase coverage by 0.19%. The diff coverage is 98.30%.

@@            Coverage Diff             @@
##           master       #6      +/-   ##
==========================================
+ Coverage   88.13%   88.32%   +0.19%     
==========================================
  Files          21       21              
  Lines        2359     2399      +40     
==========================================
+ Hits         2079     2119      +40     
  Misses        280      280              
Impacted Files Coverage Δ
src/ProtocolBuffers.jl 92.30% <ø> (ø)
src/codegen/metadata_methods.jl 97.14% <90.00%> (-2.86%) :arrow_down:
src/codegen/decode_methods.jl 98.83% <100.00%> (ø)
src/codegen/defaults.jl 96.38% <100.00%> (+1.64%) :arrow_up:
src/codegen/encode_methods.jl 90.74% <100.00%> (ø)
src/codegen/modules.jl 83.33% <100.00%> (ø)
src/codegen/toplevel_definitions.jl 96.63% <100.00%> (+0.14%) :arrow_up:
src/codegen/types.jl 94.79% <100.00%> (+5.20%) :arrow_up:
src/codec/decode.jl 77.37% <0.00%> (-1.81%) :arrow_down:
... and 1 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update caa3cf5...aedc07b. Read the comment docs.