Handle "No newline at end of file" and add --no-sync option

Change-Id: Ic40e4151eeacfd0514f5bdfb7eb268b0a08eb19b
Merge "Handle "No newline at end of file" and add --no-sync option"