Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions BUILD → java/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,10 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

sh_test(
name = "evilurl",
srcs = ["evilurl.bash"],
# TODO How to make this work despite the presence of **/BUILD files?!
data = glob(["**/*.java"]),
)
3 changes: 3 additions & 0 deletions tools/evilurl/test.bash → java/evilurl.bash
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@

set -euo pipefail


allow_list=("java/dev/enola/common/io/resource/UrlResource.java"
"java/dev/enola/common/io/resource/ClasspathResource.java")

# TODO Also grep for .toURL() invocations, and fail for any (new) ones.

echo -n "CDW = "
pwd
found_files=$(find . -name "*.java" -print0 | xargs -0 grep -lE "(^|[^a-zA-Z0-9_.])java\.net\.URL($|[^a-zA-Z0-9_#}])" | while IFS= read -r file; do
file_name=$(basename "$file")
allow_path="${file//.\//}"
Expand Down
3 changes: 0 additions & 3 deletions test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ fi

tools/version/version.bash

# TODO Remove this once evilurl is Bazel test BUILD integrated...
tools/evilurl/test.bash

# https://github.com/bazelbuild/bazel/issues/4257
echo $ Bazel testing...
if [ -z "${CI:-""}" ]; then
Expand Down