facebookresearch / gtn

Automatic differentiation with weighted finite-state transducers.
MIT License
453 stars 40 forks source link

Make copyright headers non-doc comments #14

Closed jacobkahn closed 3 years ago

jacobkahn commented 3 years ago

tl;dr:

echo "*
 * Copyright" > test.correct.txt

Remove trailing newline:

head -c -1 test.correct.txt > test.correct.2.txt

Replace with some perl:

find . -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.cuh" -o -name "*.cu"  -o -name "*.hpp" \) | xargs perl -i -p0e 's/\*\*\n \* Copyright/`cat test.correct.2.txt`/se'

Before:

Screen Shot 2020-09-30 at 1 05 11 PM

After:

Screen Shot 2020-09-30 at 1 27 04 PM