Skip to content

Add format fix for java proto options #5477

@snowp

Description

@snowp

With #5369 the presence of some java options are required in all proto files, verified by check_format.py. Since these are fairly simple additions, we should add a format fix step to check_format.py that adds these in.

The following snippet was used to add the options to existing files and might serve as inspiration for adding them this fix to check_format.py.

cd api
for f in $(find . -name "*.proto")
do
  sed -i -e '/^option\sjava_multiple_files\s=/d' $f
  sed -i -e "/^package\s/a option java_multiple_files = true;" $f
  sed -i -e '/^option\sjava_package\s=/d' $f
  cmd='grep -Po "^package \K.*(?=;$)" '"${f}"
  sed -i -e "/^package\s/a option java_package = \"io.envoyproxy.$(eval $cmd)\";" $f
done

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions