diff --git a/.nextmv/add_header.py b/.nextmv/add_header.py new file mode 100644 index 0000000..1da107c --- /dev/null +++ b/.nextmv/add_header.py @@ -0,0 +1,27 @@ +# Description: This script adds a header to all go files that are missing it. +import glob + +HEADER = "// © 2019-present nextmv.io inc" + +# List all go files in all subdirectories +go_files = glob.glob("**/*.go", recursive=True) + +# Check if the header is the first line of each file +missing = [] +checked = 0 +for file in go_files: + with open(file, "r") as f: + first_line = f.readline().strip() + if first_line != HEADER: + missing.append(file) + checked += 1 + +# Add the header to all missing files +for file in missing: + print(f"Adding header to {file}") + with open(file) as f: + content = f.read() + with open(file, "w") as f: + f.write(HEADER + "\n\n" + content) + +print(f"Checked {checked} files, added header to {len(missing)} files") diff --git a/common/alias.go b/common/alias.go index 8338670..7bdb03d 100644 --- a/common/alias.go +++ b/common/alias.go @@ -1,3 +1,5 @@ +// © 2019-present nextmv.io inc + package common import ( diff --git a/common/alias_test.go b/common/alias_test.go index 1a9fa9c..7fe96e8 100644 --- a/common/alias_test.go +++ b/common/alias_test.go @@ -1,3 +1,5 @@ +// © 2019-present nextmv.io inc + package common_test import ( diff --git a/common/boundingbox.go b/common/boundingbox.go index 258ab85..35e91be 100644 --- a/common/boundingbox.go +++ b/common/boundingbox.go @@ -1,3 +1,5 @@ +// © 2019-present nextmv.io inc + package common // BoundingBox contains information about a box. diff --git a/common/boundingbox_test.go b/common/boundingbox_test.go index 2e1b323..05d6c2c 100644 --- a/common/boundingbox_test.go +++ b/common/boundingbox_test.go @@ -1,3 +1,5 @@ +// © 2019-present nextmv.io inc + package common_test import ( diff --git a/common/distance.go b/common/distance.go index 9af3176..6bcf3f9 100644 --- a/common/distance.go +++ b/common/distance.go @@ -1,3 +1,5 @@ +// © 2019-present nextmv.io inc + // Package common contains common types and functions. package common diff --git a/common/duration.go b/common/duration.go index e664cd4..3849807 100644 --- a/common/duration.go +++ b/common/duration.go @@ -1,3 +1,5 @@ +// © 2019-present nextmv.io inc + package common import ( diff --git a/common/fast_haversine.go b/common/fast_haversine.go index 0de5430..3379275 100644 --- a/common/fast_haversine.go +++ b/common/fast_haversine.go @@ -1,3 +1,5 @@ +// © 2019-present nextmv.io inc + package common import ( diff --git a/common/haversine.go b/common/haversine.go index 36657dd..d678fa3 100644 --- a/common/haversine.go +++ b/common/haversine.go @@ -1,3 +1,5 @@ +// © 2019-present nextmv.io inc + package common import ( diff --git a/common/intersect.go b/common/intersect.go index 7c7276e..ec5505f 100644 --- a/common/intersect.go +++ b/common/intersect.go @@ -1,3 +1,5 @@ +// © 2019-present nextmv.io inc + package common // Intersect returns the intersection of two slices. diff --git a/common/location.go b/common/location.go index 3a6679d..cbdbea4 100644 --- a/common/location.go +++ b/common/location.go @@ -1,3 +1,5 @@ +// © 2019-present nextmv.io inc + package common import ( diff --git a/common/nsmallest.go b/common/nsmallest.go index aa0d62d..9987207 100644 --- a/common/nsmallest.go +++ b/common/nsmallest.go @@ -1,3 +1,5 @@ +// © 2019-present nextmv.io inc + package common import ( diff --git a/common/nsmallest_test.go b/common/nsmallest_test.go index a75c4d3..c057e85 100644 --- a/common/nsmallest_test.go +++ b/common/nsmallest_test.go @@ -1,3 +1,5 @@ +// © 2019-present nextmv.io inc + package common_test import ( diff --git a/common/speed.go b/common/speed.go index dfb7242..81f71bc 100644 --- a/common/speed.go +++ b/common/speed.go @@ -1,3 +1,5 @@ +// © 2019-present nextmv.io inc + package common import ( diff --git a/common/statistics.go b/common/statistics.go index 0ff375e..f235729 100644 --- a/common/statistics.go +++ b/common/statistics.go @@ -1,3 +1,5 @@ +// © 2019-present nextmv.io inc + package common import ( diff --git a/common/statistics_test.go b/common/statistics_test.go index d50290b..53557f9 100644 --- a/common/statistics_test.go +++ b/common/statistics_test.go @@ -1,3 +1,5 @@ +// © 2019-present nextmv.io inc + package common_test import ( diff --git a/common/utils.go b/common/utils.go index 4617d17..c3472bc 100644 --- a/common/utils.go +++ b/common/utils.go @@ -1,3 +1,5 @@ +// © 2019-present nextmv.io inc + package common import ( diff --git a/common/utils_test.go b/common/utils_test.go index f23698b..5a1dab0 100644 --- a/common/utils_test.go +++ b/common/utils_test.go @@ -1,3 +1,5 @@ +// © 2019-present nextmv.io inc + package common_test import (