check-copyright.sh 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #!/usr/bin/env bash
  2. # Copyright Materialize, Inc. and contributors. All rights reserved.
  3. #
  4. # Use of this software is governed by the Business Source License
  5. # included in the LICENSE file at the root of this repository.
  6. #
  7. # As of the Change Date specified in that file, in accordance with
  8. # the Business Source License, use of this software will be governed
  9. # by the Apache License, Version 2.0.
  10. #
  11. # check-copyright.sh — check copyright headers.
  12. set -euo pipefail
  13. cd "$(dirname "$0")/../../../.."
  14. . misc/shlib/shlib.bash
  15. files=$(git_files "$@")
  16. copyright_files=$(grep -vE \
  17. -e '(^|/)LICENSE$' \
  18. -e '(^|/)\.(docker|git|vscode|bazel)ignore$' \
  19. -e '(^|/)\.bazelrc$' \
  20. -e '(^|/)\.bazelversion$' \
  21. -e '(^|/)\.gitattributes$' \
  22. -e '(^|/)\.github/(dependabot\.yml|CODEOWNERS)$' \
  23. -e '(^|/)\.gitmodules$' \
  24. -e '(^|/)go\.sum$' \
  25. -e '(^|/)(Cargo|askama|config)\.toml$' \
  26. -e '^\.cargo/config$' \
  27. -e '^\.config/hakari.toml$' \
  28. -e '^.devcontainer/.*' \
  29. -e '(^|/)Cargo\.lock$' \
  30. -e '^about\.toml$' \
  31. -e '^deny\.toml$' \
  32. -e '(^|/)Gemfile\.lock$' \
  33. -e '^netlify\.toml$' \
  34. -e '^rustfmt\.toml$' \
  35. -e '^clippy\.toml$' \
  36. -e '^\.config/nextest\.toml$' \
  37. -e '(^|/)yarn\.lock$' \
  38. -e '(^|/)requirements.*\.txt$' \
  39. -e '\.(md|json|asc|png|jpe?g|svg|avro|avsc|pb|ico|html|so|uxf)$' \
  40. -e '^doc/user/.*(\.scss|\.bnf|\.toml|\.yml)$' \
  41. -e '^ci/builder/(ssh_known_hosts|crosstool-.+\.defconfig)$' \
  42. -e '^ci/www/public/_redirects$' \
  43. -e '^ci/test/lint-deps/' \
  44. -e '^misc/completions/.*' \
  45. -e '^misc/mcp-materialize/uv.lock' \
  46. -e '^misc/python/MANIFEST\.in' \
  47. -e '^test/chbench/chbench' \
  48. -e '^src/pgtz/tznames/.*' \
  49. -e '^test/sqllogictest/postgres/testdata/.*\.data' \
  50. -e '^test/pgtest/.*\.pt' \
  51. -e '^test/pgtest-mz/.*\.pt' \
  52. -e '^test/coordtest/.*\.ct' \
  53. -e '^test/ldbc-bi/.*\.sql' \
  54. -e '^test/ldbc-bi/.*\.log' \
  55. -e '^src/catalog/tests/snapshots/.*\.snap' \
  56. -e '^src/catalog/src/durable/upgrade/snapshots/.*' \
  57. -e '^src/catalog/src/durable/upgrade/persist/snapshots/.*\.snap' \
  58. -e '^src/expr-derive-impl/src/snapshots.*' \
  59. -e '^src/expr/src/scalar/func/impls/snapshots/.*' \
  60. -e '^src/expr/src/scalar/func/snapshots/.*' \
  61. -e '^src/expr/src/scalar/snapshots/.*' \
  62. -e '^src/license-keys/src/license_keys/.*\.pub' \
  63. -e '^src/storage-types/src/snapshots/.*' \
  64. -e '^src/repr/src/adt/snapshots/.*' \
  65. -e '^src/environmentd/tests/testdata/timezones/.*\.csv' \
  66. -e '^test/fivetran-destination/.*\/00-README$' \
  67. <<< "$files"
  68. )
  69. try xargs -n1 awk -f misc/lint/copyright.awk <<< "$copyright_files"
  70. try_status_report