stick with go generate check instead

pull/33702/head
CJ Horton 3 years ago
parent 2a5ff48e3d
commit 813369f317

@ -182,9 +182,9 @@ jobs:
- name: "Code consistency checks"
run: |
make fmtcheck importscheck generate staticcheck exhaustive protobuf copyright
make fmtcheck importscheck generate staticcheck exhaustive protobuf
if [[ -n "$(git status --porcelain)" ]]; then
echo >&2 "ERROR: Generated files are inconsistent. Run 'make generate protobuf copyright' locally and then commit the updated files."
echo >&2 "ERROR: Generated files are inconsistent. Run 'make generate' and 'make protobuf' locally and then commit the updated files."
git >&2 status --porcelain
exit 1
fi

@ -26,9 +26,6 @@ staticcheck:
exhaustive:
"$(CURDIR)/scripts/exhaustive.sh"
copyright:
"$(CURDIR)/scripts/copyright.sh"
# Run this if working on the website locally to run in watch mode.
website:
$(MAKE) -C website website

@ -0,0 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: BUSL-1.1
package main
//go:generate go run github.com/hashicorp/copywrite headers

@ -0,0 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-1.1
package plugin_protocol
//go:generate go run github.com/hashicorp/copywrite headers

@ -0,0 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-1.1
package tfplugin5
//go:generate go run github.com/hashicorp/copywrite headers

@ -0,0 +1,6 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-1.1
package tfplugin6
//go:generate go run github.com/hashicorp/copywrite headers

@ -1,17 +0,0 @@
#!/usr/bin/env bash
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: BUSL-1.1
# This script checks that all files have the appropriate copyright headers,
# according to their nearest .copywrite.hcl config file. The copyright tool
# does not natively support repos with multiple licenses, so we have to
# script this ourselves.
set -euo pipefail
# Find all directories containing a .copywrite.hcl config file
directories=$(find . -type f -name '.copywrite.hcl' -execdir pwd \;)
for dir in $directories; do
cd $dir && go run github.com/hashicorp/copywrite headers
done
Loading…
Cancel
Save