Add presubmit for Java against *ForTesting in production
For (Objective-)C++, there is _CheckNoProductionCodeUsingTestOnlyFunctions in //PRESUBMIT.py which can detect when a method with a ForTesting suffix is referenced in production code. This bug tracks adding such similar presubmit check for production .java files, which are approximated as .java files with no "test" or "junit" in the path and filename. The check is a modified copy of the one for C++. It does not attempt to share code with the C++ check, because some details are simpler for Java (e.g., no need to consider *_for_testing as well). The check is just a presubmit prompt, not error, because there are false positives to be expected. Bug: 821981 Change-Id: I3bb137197070ac696fbe0fd35d50abbfb823a8d8 Reviewed-on: https://chromium-review.googlesource.com/977581Reviewed-by:Daniel Cheng <dcheng@chromium.org> Reviewed-by:
agrieve <agrieve@chromium.org> Reviewed-by:
Bernhard Bauer <bauerb@chromium.org> Commit-Queue: Vaclav Brozek <vabr@chromium.org> Cr-Commit-Position: refs/heads/master@{#546063}
Showing
Please register or sign in to comment