Skip to content

Commit 105c5d6

Browse files
committed
Don’t require license headers in JSON files
JSON files don’t support comments and thus can’t have license headers
1 parent bc3bf13 commit 105c5d6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

+2
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,15 @@ while IFS= read -r file_path; do
6464
in) expected_file_header=$(sed -e 's|@@|##|g' <<<"${expected_file_header_template}") ;;
6565
java) expected_file_header=$(sed -e 's|@@|//|g' <<<"${expected_file_header_template}") ;;
6666
js) expected_file_header=$(sed -e 's|@@|//|g' <<<"${expected_file_header_template}") ;;
67+
json) break ;; # JSON doesn't support comments
6768
jsx) expected_file_header=$(sed -e 's|@@|//|g' <<<"${expected_file_header_template}") ;;
6869
kts) expected_file_header=$(sed -e 's|@@|//|g' <<<"${expected_file_header_template}") ;;
6970
ps1) expected_file_header=$(sed -e 's|@@|##|g' <<<"${expected_file_header_template}") ;;
7071
py) expected_file_header=$(cat <(echo '#!/usr/bin/env python3') <(sed -e 's|@@|##|g' <<<"${expected_file_header_template}")) ;;
7172
rb) expected_file_header=$(cat <(echo '#!/usr/bin/env ruby') <(sed -e 's|@@|##|g' <<<"${expected_file_header_template}")) ;;
7273
sh) expected_file_header=$(cat <(echo '#!/bin/bash') <(sed -e 's|@@|##|g' <<<"${expected_file_header_template}")) ;;
7374
swift) expected_file_header=$(sed -e 's|@@|//|g' <<<"${expected_file_header_template}") ;;
75+
swift-format) break ;; # .swift-format is JSON and doesn't support comments
7476
ts) expected_file_header=$(sed -e 's|@@|//|g' <<<"${expected_file_header_template}") ;;
7577
tsx) expected_file_header=$(sed -e 's|@@|//|g' <<<"${expected_file_header_template}") ;;
7678
*)

0 commit comments

Comments
 (0)