...

Text file src/github.com/prometheus/procfs/scripts/check_license.sh

Documentation: github.com/prometheus/procfs/scripts

     1#!/bin/sh
     2#
     3# Copyright 2018 The Prometheus Authors
     4# Licensed under the Apache License, Version 2.0 (the "License");
     5# you may not use this file except in compliance with the License.
     6# You may obtain a copy of the License at
     7#
     8# http://www.apache.org/licenses/LICENSE-2.0
     9#
    10# Unless required by applicable law or agreed to in writing, software
    11# distributed under the License is distributed on an "AS IS" BASIS,
    12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13# See the License for the specific language governing permissions and
    14# limitations under the License.
    15
    16check_license() {
    17  local file=""
    18  for file in $(find . -type f -iname '*.go' ! -path './vendor/*'); do
    19    head -n3 "${file}" | grep -Eq "(Copyright|generated|GENERATED)" || echo "  ${file}"
    20  done
    21}
    22
    23licRes=$(check_license)
    24
    25if [ -n "${licRes}" ]; then
    26  echo "license header checking failed:"
    27  echo "${licRes}"
    28  exit 255
    29fi

View as plain text