libcore: Add a libcore-patch-style script
Checks style against recommendations in http://go/libcore-patch-style
and could be used a repohook.
Update sources based on issues found with script.
Bug: 111597837
Test: cd tools/patch-style/ && awk -f libcore-patch-style.awk test-input.txt
Test: find . -type f | xargs awk -f tools/patch-style/libcore-patch-style.awk
Change-Id: I641ed2951d00b848dec7a713e08b4b9fc076baea
diff --git a/tools/patch-style/sample-input.java b/tools/patch-style/sample-input.java
new file mode 100644
index 0000000..8d55cfe
--- /dev/null
+++ b/tools/patch-style/sample-input.java
@@ -0,0 +1,32 @@
+# HAPPY PATHS
+ // BEGIN Android-added: something bot like.
+ // END Android-added: something bot like.
+
+ // BEGIN Android-changed: something bot like. http://b/12345
+ // END Android-changed: something bot like. http://b/12345
+
+ // BEGIN Android-removed: coffee stain. b/12345
+ // END Android-changed: something bot like. http://b/12345
+
+ // Android-added: hello world.
+ // Android-change: hello world. http://b/1100
+ // Android-remove: goodbye world. http://b/999912
+
+# UNHAPPY PATHS
+
+ // BEGIN Android-added something bot like.
+ // END Android-added something bot like.
+
+ // Android-note: blah
+ // Android-note: blah.
+ // Android-changed hello
+ // Android-added: hello
+
+ /* Android-note blah balh */
+ /* Android note: blah balh */
+ /* ANDROID android android android */
+ * ANDROID *
+
+Android-bar
+
+// BEGIN Android-removed: END from last line.