-
Notifications
You must be signed in to change notification settings - Fork 5.4k
format: add format fix for java proto options #5516
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -49,6 +49,9 @@ def runCheckFormat(operation, filename): | |
|
|
||
| def getInputFile(filename): | ||
| infile = os.path.join(src, filename) | ||
| directory = os.path.dirname(filename) | ||
| if not directory == '' and not os.path.isdir(directory): | ||
| os.makedirs(directory) | ||
| shutil.copyfile(infile, filename) | ||
| return filename | ||
|
|
||
|
|
@@ -58,6 +61,10 @@ def getInputFile(filename): | |
| # code. | ||
| def fixFileHelper(filename): | ||
| infile = os.path.join(src, filename) | ||
| directory = os.path.dirname(filename) | ||
| if not directory == '' and not os.path.isdir(directory): | ||
| os.makedirs(directory) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious why this is needed. If there's a filename reaching here, shouldn't we expect the directory to exist?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. At the time I added it because I had issues with the fact that the test file is
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The other mkdirs is necessary though to avoid: |
||
|
|
||
| shutil.copyfile(infile, filename) | ||
| command, status, stdout = runCheckFormat("fix", getInputFile(filename)) | ||
| return (command, infile, filename, status, stdout) | ||
|
|
@@ -194,6 +201,10 @@ def checkFileExpectingOK(filename): | |
| errors += checkUnfixableError("testing_test.cc", | ||
| "Don't use 'using testing::Test;, elaborate the type instead") | ||
|
|
||
| errors += fixFileExpectingFailure( | ||
| "api/missing_package.proto", | ||
| "Unable to find package name for proto file: ./api/missing_package.proto") | ||
|
|
||
| # The following files have errors that can be automatically fixed. | ||
| errors += checkAndFixError("over_enthusiastic_spaces.cc", | ||
| "./over_enthusiastic_spaces.cc:3: over-enthusiastic spaces") | ||
|
|
@@ -207,6 +218,7 @@ def checkFileExpectingOK(filename): | |
| errors += checkAndFixError("license.BUILD", "envoy_build_fixer check failed") | ||
| errors += checkAndFixError("bad_envoy_build_sys_ref.BUILD", "Superfluous '@envoy//' prefix") | ||
| errors += checkAndFixError("proto_format.proto", "clang-format check failed") | ||
| errors += checkAndFixError("api/java_options.proto", "Java proto option") | ||
|
|
||
| errors += checkFileExpectingOK("real_time_source_override.cc") | ||
| errors += checkFileExpectingOK("time_system_wait_for.cc") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| package envoy.foo; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| package envoy.foo; | ||
| option java_package = "io.envoyproxy.envoy.foo"; | ||
| option java_multiple_files = true; |
Uh oh!
There was an error while loading. Please reload this page.