lrascao / rebar3_gpb_plugin

A rebar3 plugin for automatically compiling .proto files using the gpb protobuf compiler
MIT License
54 stars 37 forks source link

Replace use of OTP 20+ -specific string:find #129

Closed paulo-ferraz-oliveira closed 4 years ago

paulo-ferraz-oliveira commented 4 years ago

Main goal: keep rebar.config's promise of minimum_otp_version.

If I understood correctly the goal of the (previous, now-updated) code is to check if a given proto file is part of a given path (that includes the filename). In that case, even though I tried to reach the same goal as the previous code, it might have already been incomplete already, since it would allow ab.proto and b.proto to be found, for the same search, i.e.

1> string:find("protos/ab.proto", "ab.proto", trailing).
"ab.proto"
2> string:find("protos/ab.proto", "b.proto", trailing). 
"b.proto"

Note: .travis.yml is changed so this type of issue is visible in future changes.

paulo-ferraz-oliveira commented 4 years ago

Is this something you're interested in, @lrascao?