Replacing /target:target with /target in BUILD autofix.

Bug: webrtc:9883
Change-Id: I8aac57f6223548965078e104fff1f3da44092669
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155580
Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29379}
diff --git a/tools_webrtc/gn_check_autofix.py b/tools_webrtc/gn_check_autofix.py
index e44f712..57ea0f6 100644
--- a/tools_webrtc/gn_check_autofix.py
+++ b/tools_webrtc/gn_check_autofix.py
@@ -169,6 +169,8 @@
       dep = error[index+2].strip()
       dep_path, dep = dep.split(':')
       dep = Rebase(path, dep_path, dep)
+      # Replacing /target:target with /target
+      dep = re.sub(r'/(\w+):(\1)$', r'/\1', dep)
       path = os.path.join(path[2:], 'BUILD.gn')
       errors_by_file[path][target].add(dep)
     elif error[index+1] == 'has a source file:':