From 6f621186c8e54dfd2d6dc620b26e9e34215456c4 Mon Sep 17 00:00:00 2001 From: alex Date: Sat, 21 Jul 2018 16:24:29 +0200 Subject: [PATCH] Trim trailing whitespace If a license text had blank lines, they would result in a trailing whitespace when prefixed with the line comments. This change removes trailing whitespace from the middle lines, leaving top and bottom as is. Fixes #10 --- testdata/expected/file.c | 6 +++--- testdata/expected/file.cc | 6 +++--- testdata/expected/file.cpp | 6 +++--- testdata/expected/file.cs | 6 +++--- testdata/expected/file.css | 6 +++--- testdata/expected/file.dart | 6 +++--- testdata/expected/file.el | 6 +++--- testdata/expected/file.erl | 6 +++--- testdata/expected/file.go | 6 +++--- testdata/expected/file.h | 6 +++--- testdata/expected/file.hh | 6 +++--- testdata/expected/file.hpp | 6 +++--- testdata/expected/file.hs | 6 +++--- testdata/expected/file.html | 6 +++--- testdata/expected/file.java | 6 +++--- testdata/expected/file.js | 6 +++--- testdata/expected/file.lisp | 6 +++--- testdata/expected/file.m | 6 +++--- testdata/expected/file.mm | 6 +++--- testdata/expected/file.php | 6 +++--- testdata/expected/file.proto | 6 +++--- testdata/expected/file.py | 6 +++--- testdata/expected/file.rs | 6 +++--- testdata/expected/file.scala | 6 +++--- testdata/expected/file.swift | 6 +++--- testdata/expected/file.tf | 6 +++--- testdata/expected/file.xml | 6 +++--- testdata/expected/file1.sh | 6 +++--- testdata/expected/file2.sh | 6 +++--- tmpl.go | 20 +++++++++----------- 30 files changed, 96 insertions(+), 98 deletions(-) diff --git a/testdata/expected/file.c b/testdata/expected/file.c index ca2511c..7876b80 100644 --- a/testdata/expected/file.c +++ b/testdata/expected/file.c @@ -1,12 +1,12 @@ /* * Copyright 2016 Google Inc. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/testdata/expected/file.cc b/testdata/expected/file.cc index 08f8e6f..53656ed 100644 --- a/testdata/expected/file.cc +++ b/testdata/expected/file.cc @@ -1,11 +1,11 @@ // Copyright 2016 Google Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/testdata/expected/file.cpp b/testdata/expected/file.cpp index 08f8e6f..53656ed 100644 --- a/testdata/expected/file.cpp +++ b/testdata/expected/file.cpp @@ -1,11 +1,11 @@ // Copyright 2016 Google Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/testdata/expected/file.cs b/testdata/expected/file.cs index 3634bcf..8137f4f 100644 --- a/testdata/expected/file.cs +++ b/testdata/expected/file.cs @@ -1,11 +1,11 @@ // Copyright 2016 Google Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/testdata/expected/file.css b/testdata/expected/file.css index d028d74..8c01d2d 100644 --- a/testdata/expected/file.css +++ b/testdata/expected/file.css @@ -1,12 +1,12 @@ /** * Copyright 2016 Google Inc. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/testdata/expected/file.dart b/testdata/expected/file.dart index decb9ee..8902b4a 100644 --- a/testdata/expected/file.dart +++ b/testdata/expected/file.dart @@ -1,11 +1,11 @@ // Copyright 2016 Google Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/testdata/expected/file.el b/testdata/expected/file.el index 1487198..aa2a060 100644 --- a/testdata/expected/file.el +++ b/testdata/expected/file.el @@ -1,11 +1,11 @@ ;; Copyright 2016 Google Inc. -;; +;; ;; Licensed under the Apache License, Version 2.0 (the "License"); ;; you may not use this file except in compliance with the License. ;; You may obtain a copy of the License at -;; +;; ;; http://www.apache.org/licenses/LICENSE-2.0 -;; +;; ;; Unless required by applicable law or agreed to in writing, software ;; distributed under the License is distributed on an "AS IS" BASIS, ;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/testdata/expected/file.erl b/testdata/expected/file.erl index 003d661..190d223 100644 --- a/testdata/expected/file.erl +++ b/testdata/expected/file.erl @@ -1,11 +1,11 @@ % Copyright 2016 Google Inc. -% +% % Licensed under the Apache License, Version 2.0 (the "License"); % you may not use this file except in compliance with the License. % You may obtain a copy of the License at -% +% % http://www.apache.org/licenses/LICENSE-2.0 -% +% % Unless required by applicable law or agreed to in writing, software % distributed under the License is distributed on an "AS IS" BASIS, % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/testdata/expected/file.go b/testdata/expected/file.go index 864e0fc..7efc920 100644 --- a/testdata/expected/file.go +++ b/testdata/expected/file.go @@ -1,11 +1,11 @@ // Copyright 2016 Google Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/testdata/expected/file.h b/testdata/expected/file.h index 6eef681..fddab60 100644 --- a/testdata/expected/file.h +++ b/testdata/expected/file.h @@ -1,12 +1,12 @@ /* * Copyright 2016 Google Inc. - * + * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/testdata/expected/file.hh b/testdata/expected/file.hh index 406d417..817dc30 100644 --- a/testdata/expected/file.hh +++ b/testdata/expected/file.hh @@ -1,11 +1,11 @@ // Copyright 2016 Google Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/testdata/expected/file.hpp b/testdata/expected/file.hpp index 406d417..817dc30 100644 --- a/testdata/expected/file.hpp +++ b/testdata/expected/file.hpp @@ -1,11 +1,11 @@ // Copyright 2016 Google Inc. -// +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/testdata/expected/file.hs b/testdata/expected/file.hs index 54876ef..92f22dc 100644 --- a/testdata/expected/file.hs +++ b/testdata/expected/file.hs @@ -1,11 +1,11 @@ -- Copyright 2016 Google Inc. --- +-- -- Licensed under the Apache License, Version 2.0 (the "License"); -- you may not use this file except in compliance with the License. -- You may obtain a copy of the License at --- +-- -- http://www.apache.org/licenses/LICENSE-2.0 --- +-- -- Unless required by applicable law or agreed to in writing, software -- distributed under the License is distributed on an "AS IS" BASIS, -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/testdata/expected/file.html b/testdata/expected/file.html index 108603b..60cb4e0 100644 --- a/testdata/expected/file.html +++ b/testdata/expected/file.html @@ -1,12 +1,12 @@