From 1168b15874b24d9a959f48eaf3886e0af87e5eb9 Mon Sep 17 00:00:00 2001 From: Franz Busch Date: Fri, 12 Jul 2024 12:07:43 +0200 Subject: [PATCH 1/2] [GHA] Configure license check --- .github/workflows/pull_request.yml | 3 ++- .licenseignore | 39 ++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .licenseignore diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index a104686a..4198d574 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -9,4 +9,5 @@ jobs: name: Checks uses: apple/swift-nio/.github/workflows/reusable_pull_request.yml@main with: - benchmarks_linux_enabled: false \ No newline at end of file + benchmarks_linux_enabled: false + license_header_check_project_name: "SwiftOpenAPIGenerator" diff --git a/.licenseignore b/.licenseignore new file mode 100644 index 00000000..a954f36c --- /dev/null +++ b/.licenseignore @@ -0,0 +1,39 @@ +.gitignore +.licenseignore +.spi.yml +.swift-format +.github/* +CODE_OF_CONDUCT.md +CONTRIBUTING.md +CONTRIBUTORS.txt +LICENSE.txt +NOTICE.txt +Package.swift +Package.resolved +README.md +SECURITY.md +scripts/unacceptable-language.txt +Tests/PetstoreConsumerTests/Generated +Tests/OpenAPIGeneratorReferenceTests/Resources/ReferenceSources/* +docker/* +**/*.docc/* +**/.gitignore +**/Package.swift +**/Package.resolved +**/README.md +**/openapi.yaml +**/openapi.yml +**/petstore.yaml +**/openapi-generator-config.yaml +**/openapi-generator-config.yml +**/docker-compose.yaml +**/docker/* +**/.dockerignore +Plugins/OpenAPIGenerator/PluginsShared +Plugins/OpenAPIGeneratorCommand/PluginsShared +Examples/HelloWorldiOSClientAppExample/HelloWorldiOSClientApp.* +Examples/HelloWorldiOSClientAppExample/HelloWorldiOSClientApp/Assets.xcassets/* +Examples/HelloWorldiOSClientAppExample/HelloWorldiOSClientApp/Preview* +Examples/**/Generated* +**/Makefile +**/*.html \ No newline at end of file From 9d7b6e89b7fa1296abce3db41d4e7648bed9792e Mon Sep 17 00:00:00 2001 From: Franz Busch Date: Fri, 12 Jul 2024 12:12:43 +0200 Subject: [PATCH 2/2] Use #!/bin/bash --- .github/workflows/pull_request.yml | 1 + scripts/check-for-broken-symlinks.sh | 2 +- scripts/check-for-docc-warnings.sh | 2 +- scripts/check-for-unacceptable-language.sh | 2 +- scripts/check-license-headers.sh | 4 ++-- scripts/generate-contributors-list.sh | 2 +- scripts/run-integration-test.sh | 2 +- scripts/run-swift-format.sh | 2 +- scripts/soundness.sh | 2 +- scripts/test-examples.sh | 2 +- 10 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 4198d574..d3219d76 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -10,4 +10,5 @@ jobs: uses: apple/swift-nio/.github/workflows/reusable_pull_request.yml@main with: benchmarks_linux_enabled: false + unacceptable_language_check_enabled: false license_header_check_project_name: "SwiftOpenAPIGenerator" diff --git a/scripts/check-for-broken-symlinks.sh b/scripts/check-for-broken-symlinks.sh index 4df8c92b..82cadb49 100644 --- a/scripts/check-for-broken-symlinks.sh +++ b/scripts/check-for-broken-symlinks.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash ##===----------------------------------------------------------------------===## ## ## This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/scripts/check-for-docc-warnings.sh b/scripts/check-for-docc-warnings.sh index 88215d49..b9453355 100644 --- a/scripts/check-for-docc-warnings.sh +++ b/scripts/check-for-docc-warnings.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash ##===----------------------------------------------------------------------===## ## ## This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/scripts/check-for-unacceptable-language.sh b/scripts/check-for-unacceptable-language.sh index 94f79dfc..759afa66 100644 --- a/scripts/check-for-unacceptable-language.sh +++ b/scripts/check-for-unacceptable-language.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash ##===----------------------------------------------------------------------===## ## ## This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/scripts/check-license-headers.sh b/scripts/check-license-headers.sh index fdb2a031..2e89b5ec 100644 --- a/scripts/check-license-headers.sh +++ b/scripts/check-license-headers.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash ##===----------------------------------------------------------------------===## ## ## This source file is part of the SwiftOpenAPIGenerator open source project @@ -87,7 +87,7 @@ for FILE_PATH in "${PATHS_TO_CHECK_FOR_LICENSE[@]}"; do case "${FILE_EXTENSION}" in swift) EXPECTED_FILE_HEADER=$(sed -e 's|@@|//|g' <<<"${EXPECTED_FILE_HEADER_TEMPLATE}") ;; yml) EXPECTED_FILE_HEADER=$(sed -e 's|@@|##|g' <<<"${EXPECTED_FILE_HEADER_TEMPLATE}") ;; - sh) EXPECTED_FILE_HEADER=$(cat <(echo '#!/usr/bin/env bash') <(sed -e 's|@@|##|g' <<<"${EXPECTED_FILE_HEADER_TEMPLATE}")) ;; + sh) EXPECTED_FILE_HEADER=$(cat <(echo '#!/bin/bash') <(sed -e 's|@@|##|g' <<<"${EXPECTED_FILE_HEADER_TEMPLATE}")) ;; *) fatal "Unsupported file extension for file (exclude or update this script): ${FILE_PATH}" ;; esac EXPECTED_FILE_HEADER_LINECOUNT=$(wc -l <<<"${EXPECTED_FILE_HEADER}") diff --git a/scripts/generate-contributors-list.sh b/scripts/generate-contributors-list.sh index c733766f..272f788d 100644 --- a/scripts/generate-contributors-list.sh +++ b/scripts/generate-contributors-list.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash ##===----------------------------------------------------------------------===## ## ## This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/scripts/run-integration-test.sh b/scripts/run-integration-test.sh index fae9d366..61378588 100644 --- a/scripts/run-integration-test.sh +++ b/scripts/run-integration-test.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash ##===----------------------------------------------------------------------===## ## ## This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/scripts/run-swift-format.sh b/scripts/run-swift-format.sh index 2f0f95f2..beebc2e6 100755 --- a/scripts/run-swift-format.sh +++ b/scripts/run-swift-format.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash ##===----------------------------------------------------------------------===## ## ## This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/scripts/soundness.sh b/scripts/soundness.sh index 45ee0f30..2d15984c 100755 --- a/scripts/soundness.sh +++ b/scripts/soundness.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash ##===----------------------------------------------------------------------===## ## ## This source file is part of the SwiftOpenAPIGenerator open source project diff --git a/scripts/test-examples.sh b/scripts/test-examples.sh index 62d12135..fb90d572 100644 --- a/scripts/test-examples.sh +++ b/scripts/test-examples.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/bash ##===----------------------------------------------------------------------===## ## ## This source file is part of the SwiftOpenAPIGenerator open source project