Skip to content

Commit 61881f8

Browse files
authored
Merge pull request #38 from swiftlang/fb-fix-license
Fix license header check ignoring well known files
2 parents 85e54b8 + d7354ae commit 61881f8

8 files changed

+82
-68
lines changed

.github/workflows/scripts/check-broken-symlinks.sh

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/bin/bash
2-
# ===----------------------------------------------------------------------===//
3-
#
4-
# This source file is part of the Swift.org open source project
5-
#
6-
# Copyright (c) 2024 Apple Inc. and the Swift project authors
7-
# Licensed under Apache License v2.0 with Runtime Library Exception
8-
#
9-
# See https://swift.org/LICENSE.txt for license information
10-
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
11-
#
12-
# ===----------------------------------------------------------------------===//
2+
## ===----------------------------------------------------------------------===##
3+
##
4+
## This source file is part of the Swift.org open source project
5+
##
6+
## Copyright (c) 2024 Apple Inc. and the Swift project authors
7+
## Licensed under Apache License v2.0 with Runtime Library Exception
8+
##
9+
## See https://swift.org/LICENSE.txt for license information
10+
## See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
11+
##
12+
## ===----------------------------------------------------------------------===##
1313

1414
set -euo pipefail
1515

.github/workflows/scripts/check-docs.sh

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/bin/bash
2-
# ===----------------------------------------------------------------------===//
3-
#
4-
# This source file is part of the Swift.org open source project
5-
#
6-
# Copyright (c) 2024 Apple Inc. and the Swift project authors
7-
# Licensed under Apache License v2.0 with Runtime Library Exception
8-
#
9-
# See https://swift.org/LICENSE.txt for license information
10-
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
11-
#
12-
# ===----------------------------------------------------------------------===//
2+
## ===----------------------------------------------------------------------===##
3+
##
4+
## This source file is part of the Swift.org open source project
5+
##
6+
## Copyright (c) 2024 Apple Inc. and the Swift project authors
7+
## Licensed under Apache License v2.0 with Runtime Library Exception
8+
##
9+
## See https://swift.org/LICENSE.txt for license information
10+
## See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
11+
##
12+
## ===----------------------------------------------------------------------===##
1313

1414
set -euo pipefail
1515

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

+16-16
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/bin/bash
2-
# ===----------------------------------------------------------------------===//
3-
#
4-
# This source file is part of the Swift.org open source project
5-
#
6-
# Copyright (c) 2024 Apple Inc. and the Swift project authors
7-
# Licensed under Apache License v2.0 with Runtime Library Exception
8-
#
9-
# See https://swift.org/LICENSE.txt for license information
10-
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
11-
#
12-
# ===----------------------------------------------------------------------===//
2+
## ===----------------------------------------------------------------------===##
3+
##
4+
## This source file is part of the Swift.org open source project
5+
##
6+
## Copyright (c) 2024 Apple Inc. and the Swift project authors
7+
## Licensed under Apache License v2.0 with Runtime Library Exception
8+
##
9+
## See https://swift.org/LICENSE.txt for license information
10+
## See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
11+
##
12+
## ===----------------------------------------------------------------------===##
1313

1414
set -euo pipefail
1515

@@ -40,12 +40,12 @@ fi
4040

4141
paths_with_missing_license=( )
4242

43-
file_excludes=".license_header_template
44-
.licenseignore"
45-
if [ -f .licenseignore ]; then
46-
file_excludes=$file_excludes$(printf '\n')$(cat .licenseignore)
43+
if [[ -f .licenseignore ]]; then
44+
file_paths=$(tr '\n' '\0' < .licenseignore | xargs -0 -I% printf '":(exclude)%" '| xargs git ls-files ":(exclude).licenseignore" ":(exclude).license_header_template" )
45+
else
46+
file_paths=$(git ls-files ":(exclude).license_header_template" )
4747
fi
48-
file_paths=$(echo "$file_excludes" | tr '\n' '\0' | xargs -0 -I% printf '":(exclude)%" '| xargs git ls-files)
48+
4949

5050
while IFS= read -r file_path; do
5151
file_basename=$(basename -- "${file_path}")

.github/workflows/scripts/check-swift-format.sh

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/bin/bash
2-
# ===----------------------------------------------------------------------===//
3-
#
4-
# This source file is part of the Swift.org open source project
5-
#
6-
# Copyright (c) 2024 Apple Inc. and the Swift project authors
7-
# Licensed under Apache License v2.0 with Runtime Library Exception
8-
#
9-
# See https://swift.org/LICENSE.txt for license information
10-
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
11-
#
12-
# ===----------------------------------------------------------------------===//
2+
## ===----------------------------------------------------------------------===##
3+
##
4+
## This source file is part of the Swift.org open source project
5+
##
6+
## Copyright (c) 2024 Apple Inc. and the Swift project authors
7+
## Licensed under Apache License v2.0 with Runtime Library Exception
8+
##
9+
## See https://swift.org/LICENSE.txt for license information
10+
## See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
11+
##
12+
## ===----------------------------------------------------------------------===##
1313

1414
set -euo pipefail
1515

.github/workflows/scripts/check-unacceptable-language.sh

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/bin/bash
2-
# ===----------------------------------------------------------------------===//
3-
#
4-
# This source file is part of the Swift.org open source project
5-
#
6-
# Copyright (c) 2024 Apple Inc. and the Swift project authors
7-
# Licensed under Apache License v2.0 with Runtime Library Exception
8-
#
9-
# See https://swift.org/LICENSE.txt for license information
10-
# See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
11-
#
12-
# ===----------------------------------------------------------------------===//
2+
## ===----------------------------------------------------------------------===##
3+
##
4+
## This source file is part of the Swift.org open source project
5+
##
6+
## Copyright (c) 2024 Apple Inc. and the Swift project authors
7+
## Licensed under Apache License v2.0 with Runtime Library Exception
8+
##
9+
## See https://swift.org/LICENSE.txt for license information
10+
## See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
11+
##
12+
## ===----------------------------------------------------------------------===##
1313

1414
set -euo pipefail
1515

.license_header_template

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## ===----------------------------------------------------------------------===##
2+
##
3+
## This source file is part of the Swift.org open source project
4+
##
5+
## Copyright (c) YEARS Apple Inc. and the Swift project authors
6+
## Licensed under Apache License v2.0 with Runtime Library Exception
7+
##
8+
## See https://swift.org/LICENSE.txt for license information
9+
## See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+
##
11+
## ===----------------------------------------------------------------------===##

.licenseignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.github/workflows/configs/.flake8
2+
**/*.yml
3+
CODEOWNERS
4+
LICENSE.txt
5+
README.md

tests/test.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
#!/usr/bin/env python3
2-
##===----------------------------------------------------------------------===##
2+
## ===----------------------------------------------------------------------===##
33
##
44
## This source file is part of the Swift.org open source project
55
##
6-
## Copyright (c) 2020 Apple Inc. and the Swift.org project authors
7-
## Licensed under Apache License v2.0
6+
## Copyright (c) 2024 Apple Inc. and the Swift project authors
7+
## Licensed under Apache License v2.0 with Runtime Library Exception
88
##
9-
## See LICENSE.txt for license information
10-
## See CONTRIBUTORS.txt for the list of Swift.org project authors
9+
## See https://swift.org/LICENSE.txt for license information
10+
## See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
1111
##
12-
## SPDX-License-Identifier: Apache-2.0
13-
##
14-
##===----------------------------------------------------------------------===##
12+
## ===----------------------------------------------------------------------===##

0 commit comments

Comments
 (0)