Skip to content

Commit

Permalink
Add headers, add header adding script
Browse files Browse the repository at this point in the history
  • Loading branch information
merschformann committed Mar 13, 2024
1 parent 71acfd6 commit c0e0928
Show file tree
Hide file tree
Showing 18 changed files with 61 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .nextmv/add_header.py
Original file line number Diff line number Diff line change
@@ -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")
2 changes: 2 additions & 0 deletions common/alias.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// © 2019-present nextmv.io inc

package common

import (
Expand Down
2 changes: 2 additions & 0 deletions common/alias_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// © 2019-present nextmv.io inc

package common_test

import (
Expand Down
2 changes: 2 additions & 0 deletions common/boundingbox.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// © 2019-present nextmv.io inc

package common

// BoundingBox contains information about a box.
Expand Down
2 changes: 2 additions & 0 deletions common/boundingbox_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// © 2019-present nextmv.io inc

package common_test

import (
Expand Down
2 changes: 2 additions & 0 deletions common/distance.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// © 2019-present nextmv.io inc

// Package common contains common types and functions.
package common

Expand Down
2 changes: 2 additions & 0 deletions common/duration.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// © 2019-present nextmv.io inc

package common

import (
Expand Down
2 changes: 2 additions & 0 deletions common/fast_haversine.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// © 2019-present nextmv.io inc

package common

import (
Expand Down
2 changes: 2 additions & 0 deletions common/haversine.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// © 2019-present nextmv.io inc

package common

import (
Expand Down
2 changes: 2 additions & 0 deletions common/intersect.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// © 2019-present nextmv.io inc

package common

// Intersect returns the intersection of two slices.
Expand Down
2 changes: 2 additions & 0 deletions common/location.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// © 2019-present nextmv.io inc

package common

import (
Expand Down
2 changes: 2 additions & 0 deletions common/nsmallest.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// © 2019-present nextmv.io inc

package common

import (
Expand Down
2 changes: 2 additions & 0 deletions common/nsmallest_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// © 2019-present nextmv.io inc

package common_test

import (
Expand Down
2 changes: 2 additions & 0 deletions common/speed.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// © 2019-present nextmv.io inc

package common

import (
Expand Down
2 changes: 2 additions & 0 deletions common/statistics.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// © 2019-present nextmv.io inc

package common

import (
Expand Down
2 changes: 2 additions & 0 deletions common/statistics_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// © 2019-present nextmv.io inc

package common_test

import (
Expand Down
2 changes: 2 additions & 0 deletions common/utils.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// © 2019-present nextmv.io inc

package common

import (
Expand Down
2 changes: 2 additions & 0 deletions common/utils_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// © 2019-present nextmv.io inc

package common_test

import (
Expand Down

0 comments on commit c0e0928

Please sign in to comment.