Skip to content

Commit 16a7278

Browse files
authored
Merge pull request #101 from ahoppen/more-license-header-extensions
Add more file extensions to check-license-header.sh
2 parents 97480b8 + b92ae42 commit 16a7278

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

.github/workflows/scripts/check-license-header.sh

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,29 +63,42 @@ while IFS= read -r file_path; do
6363
# shellcheck disable=SC2001 # We prefer to use sed here instead of bash search/replace
6464
case "${file_extension}" in
6565
bazel) comment_marker='##' ;;
66-
bzl) comment_marker='##' ;;
6766
bazelrc) comment_marker='##' ;;
67+
bzl) comment_marker='##' ;;
6868
c) comment_marker='//' ;;
6969
cmake) comment_marker='##' ;;
70+
code-workspace) continue ;; # VS Code workspaces are JSON and shouldn't contain comments
71+
CODEOWNERS) continue ;; # Doesn't need a license header
72+
Dockerfile) comment_marker='##' ;;
7073
editorconfig) comment_marker='##' ;;
74+
flake8) continue ;; # Configuration file doesn't need a license header
75+
gitignore) continue ;; # Configuration files don't need license headers
7176
gradle) comment_marker='//' ;;
7277
groovy) comment_marker='//' ;;
78+
gyb) comment_marker='//' ;;
7379
h) comment_marker='//' ;;
7480
in) comment_marker='##' ;;
7581
java) comment_marker='//' ;;
7682
js) comment_marker='//' ;;
77-
json) continue ;; # JSON doesn't support comments
83+
json) continue ;; # JSON doesn't support line comments
7884
jsx) comment_marker='//' ;;
7985
kts) comment_marker='//' ;;
86+
md) continue ;; # Text files don't need license headers
87+
mobileconfig) continue ;; # Doesn't support comments
88+
modulemap) continue ;; # Configuration file doesn't need a license header
89+
plist) continue ;; # Plists don't support line comments
8090
proto) comment_marker='//' ;;
8191
ps1) comment_marker='##' ;;
8292
py) comment_marker='##'; header_prefix=$'#!/usr/bin/env python3\n' ;;
8393
rb) comment_marker='##'; header_prefix=$'#!/usr/bin/env ruby\n' ;;
8494
sh) comment_marker='##'; header_prefix=$'#!/bin/bash\n' ;;
85-
swift) comment_marker='//' ;;
8695
swift-format) continue ;; # .swift-format is JSON and doesn't support comments
96+
swift) comment_marker='//' ;;
8797
ts) comment_marker='//' ;;
8898
tsx) comment_marker='//' ;;
99+
txt) continue ;; # Text files don't need license headers
100+
yml) continue ;; # YAML Configuration files don't need license headers
101+
yaml) continue ;; # YAML Configuration files don't need license headers
89102
*)
90103
error "Unsupported file extension ${file_extension} for file (exclude or update this script): ${file_path}"
91104
paths_with_missing_license+=("${file_path} ")

0 commit comments

Comments
 (0)