treewide: add license header and enable haslicense linter

Change-Id: I873a8d4082d75e8f813d8a726a41187eea7a065e
Reviewed-on: https://review.monogon.dev/c/monogon/+/3825
Tested-by: Jenkins CI
Reviewed-by: Leopold Schabel <leo@monogon.tech>
diff --git a/build/analysis/BUILD.bazel b/build/analysis/BUILD.bazel
index 371336a..91a2f20 100644
--- a/build/analysis/BUILD.bazel
+++ b/build/analysis/BUILD.bazel
@@ -92,7 +92,7 @@
     "//build/analysis/noioutil",
     "//build/analysis/importsort",
     "//build/analysis/gofmt",
-    #    "//build/analysis/haslicense", #TODO(tim): Enable when fixed
+    "//build/analysis/haslicense",
 ]
 
 # NOGO_CONFIG_OVERRIDES contains the overrides for nogo to exempt specific files
diff --git a/build/analysis/checkcompilerdirectives/checkcompilerdirectives.go b/build/analysis/checkcompilerdirectives/checkcompilerdirectives.go
index a3bbe85..b478fae 100644
--- a/build/analysis/checkcompilerdirectives/checkcompilerdirectives.go
+++ b/build/analysis/checkcompilerdirectives/checkcompilerdirectives.go
@@ -1,3 +1,6 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 package checkcompilerdirectives
 
 import "4d63.com/gocheckcompilerdirectives/checkcompilerdirectives"
diff --git a/build/analysis/gofmt/gofmt.go b/build/analysis/gofmt/gofmt.go
index 817ce05..782fa1d 100644
--- a/build/analysis/gofmt/gofmt.go
+++ b/build/analysis/gofmt/gofmt.go
@@ -1,3 +1,6 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 package gofmt
 
 import (
diff --git a/build/analysis/importsort/classify.go b/build/analysis/importsort/classify.go
index dc5c45d..88d425e 100644
--- a/build/analysis/importsort/classify.go
+++ b/build/analysis/importsort/classify.go
@@ -1,3 +1,6 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 package importsort
 
 import (
diff --git a/build/analysis/importsort/importsort.go b/build/analysis/importsort/importsort.go
index 1b33b3b..6620a04 100644
--- a/build/analysis/importsort/importsort.go
+++ b/build/analysis/importsort/importsort.go
@@ -1,3 +1,6 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 // importsort implements import grouping style checks as per
 // CODING_STANDARDS.md.
 package importsort
diff --git a/build/analysis/importsort/importsort_test.go b/build/analysis/importsort/importsort_test.go
index 723e7d2..2ad2465 100644
--- a/build/analysis/importsort/importsort_test.go
+++ b/build/analysis/importsort/importsort_test.go
@@ -1,3 +1,6 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 package importsort
 
 import (
diff --git a/build/analysis/lib/generated.go b/build/analysis/lib/generated.go
index 209a73f..c70a49b 100644
--- a/build/analysis/lib/generated.go
+++ b/build/analysis/lib/generated.go
@@ -1,3 +1,6 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 package lib
 
 import (
diff --git a/build/analysis/lib/genstd/main.go b/build/analysis/lib/genstd/main.go
index eae356b..cfb201d 100644
--- a/build/analysis/lib/genstd/main.go
+++ b/build/analysis/lib/genstd/main.go
@@ -1,3 +1,6 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 // This tool generates //build/analysis/lib:stdlib_packages.go, which contains a
 // set of all Go stdlib packges. This is generated ahead of time in the build
 // system as it can be an expensive operation that also depends on the presence
diff --git a/build/analysis/noioutil/noioutil.go b/build/analysis/noioutil/noioutil.go
index b98a921..69223b1 100644
--- a/build/analysis/noioutil/noioutil.go
+++ b/build/analysis/noioutil/noioutil.go
@@ -1,3 +1,6 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 // Package noioutil contains a Go analysis pass designed to prevent use of the
 // deprecated ioutil package for which a tree-wide migration was already done.
 package noioutil
diff --git a/build/analysis/tools.go b/build/analysis/tools.go
index 7936b16..de52ca0 100644
--- a/build/analysis/tools.go
+++ b/build/analysis/tools.go
@@ -1,3 +1,6 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 //go:build tools
 // +build tools
 
diff --git a/build/bazel_cc_fix/ccfixspec/gomod-generated-placeholder.go b/build/bazel_cc_fix/ccfixspec/gomod-generated-placeholder.go
index 333b80f..19cc142 100644
--- a/build/bazel_cc_fix/ccfixspec/gomod-generated-placeholder.go
+++ b/build/bazel_cc_fix/ccfixspec/gomod-generated-placeholder.go
@@ -1 +1,4 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 package ccfixspec
diff --git a/build/bazel_cc_fix/main.go b/build/bazel_cc_fix/main.go
index a83374d..b0d625b 100644
--- a/build/bazel_cc_fix/main.go
+++ b/build/bazel_cc_fix/main.go
@@ -1,18 +1,5 @@
-// Copyright 2020 The Monogon Project Authors.
-//
+// Copyright The Monogon Project Authors.
 // SPDX-License-Identifier: Apache-2.0
-//
-// 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.
-// See the License for the specific language governing permissions and
-// limitations under the License.
 
 // bazel_cc_fix rewrites include directives in C and C++ code. It rewrites all
 // includes in the target workspace to be workspace-relative and additionally
diff --git a/build/gotoolwrap/main.go b/build/gotoolwrap/main.go
index 343b7ff..d4599a1 100644
--- a/build/gotoolwrap/main.go
+++ b/build/gotoolwrap/main.go
@@ -1,18 +1,5 @@
-// Copyright 2020 The Monogon Project Authors.
-//
+// Copyright The Monogon Project Authors.
 // SPDX-License-Identifier: Apache-2.0
-//
-// 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.
-// See the License for the specific language governing permissions and
-// limitations under the License.
 
 // gotoolwrap is a tiny wrapper used to run executables that expect a standard
 // Go development environment setup to act on the monogon workspace. Notably,
diff --git a/build/mirror_proxy/main.go b/build/mirror_proxy/main.go
index 9dd0d0e..101a735 100644
--- a/build/mirror_proxy/main.go
+++ b/build/mirror_proxy/main.go
@@ -1,3 +1,6 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 package main
 
 import (
diff --git a/build/savestdout/savestdout.go b/build/savestdout/savestdout.go
index e8c8e75..095f1cf 100644
--- a/build/savestdout/savestdout.go
+++ b/build/savestdout/savestdout.go
@@ -1,18 +1,5 @@
-// Copyright 2020 The Monogon Project Authors.
-//
+// Copyright The Monogon Project Authors.
 // SPDX-License-Identifier: Apache-2.0
-//
-// 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.
-// See the License for the specific language governing permissions and
-// limitations under the License.
 
 package main
 
diff --git a/build/sqlc/tool-dep/gomod-generated-placeholder.go b/build/sqlc/tool-dep/gomod-generated-placeholder.go
index 1f6e0f9..388d884 100644
--- a/build/sqlc/tool-dep/gomod-generated-placeholder.go
+++ b/build/sqlc/tool-dep/gomod-generated-placeholder.go
@@ -1,3 +1,6 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 //go:build tools
 // +build tools
 
diff --git a/build/static_binary_tarball/main.go b/build/static_binary_tarball/main.go
index b7b3612..f2f7067 100644
--- a/build/static_binary_tarball/main.go
+++ b/build/static_binary_tarball/main.go
@@ -1,18 +1,5 @@
-// Copyright 2020 The Monogon Project Authors.
-//
+// Copyright The Monogon Project Authors.
 // SPDX-License-Identifier: Apache-2.0
-//
-// 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.
-// See the License for the specific language governing permissions and
-// limitations under the License.
 
 package main
 
diff --git a/build/static_binary_tarball/spec/gomod-generated-placeholder.go b/build/static_binary_tarball/spec/gomod-generated-placeholder.go
index f09cd57..ca2145c 100644
--- a/build/static_binary_tarball/spec/gomod-generated-placeholder.go
+++ b/build/static_binary_tarball/spec/gomod-generated-placeholder.go
@@ -1 +1,4 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 package spec
diff --git a/build/toolbase/doc.go b/build/toolbase/doc.go
index 8bf9e25..065d96f 100644
--- a/build/toolbase/doc.go
+++ b/build/toolbase/doc.go
@@ -1,3 +1,6 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 // toolbase implements common functionality for tools operating on a Monogon
 // workspace, notably CI and developer tools.
 package toolbase
diff --git a/build/toolbase/gotoolchain/toolchain_test.go b/build/toolbase/gotoolchain/toolchain_test.go
index 7b93d6d..2f13d80 100644
--- a/build/toolbase/gotoolchain/toolchain_test.go
+++ b/build/toolbase/gotoolchain/toolchain_test.go
@@ -1,3 +1,6 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 package gotoolchain
 
 import (
diff --git a/build/toolbase/label.go b/build/toolbase/label.go
index 5d033b3..a16860d 100644
--- a/build/toolbase/label.go
+++ b/build/toolbase/label.go
@@ -1,3 +1,6 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 package toolbase
 
 import (
diff --git a/build/toolbase/label_test.go b/build/toolbase/label_test.go
index e16d88f..558edae 100644
--- a/build/toolbase/label_test.go
+++ b/build/toolbase/label_test.go
@@ -1,3 +1,6 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 package toolbase
 
 import (
diff --git a/build/toolbase/workspace.go b/build/toolbase/workspace.go
index f1d9f08..5213504 100644
--- a/build/toolbase/workspace.go
+++ b/build/toolbase/workspace.go
@@ -1,3 +1,6 @@
+// Copyright The Monogon Project Authors.
+// SPDX-License-Identifier: Apache-2.0
+
 package toolbase
 
 import (