Skip to content

Commit

Permalink
fix check license header script
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir committed Aug 29, 2023
1 parent b4f8ce6 commit 99398f2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .scripts/ci/check-license-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ SPDX-License-Identifier: Apache-2.0
SPDX-License-Identifier: MIT`
const bundlerLicense =
'// Copyright 2016-2019 Cargo-Bundle developers <https://github.com/burtonageo/cargo-bundle>'
const denoLicense =
'// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.'

const extensions = ['.rs', '.js', '.ts', '.yml', '.swift', '.kt']
const ignore = [
Expand All @@ -26,7 +28,10 @@ const ignore = [
]

async function checkFile(file) {
if (extensions.some((e) => file.endsWith(e)) && !ignore.some((i) => file.includes(`/${i}/`))) {
if (
extensions.some((e) => file.endsWith(e)) &&
!ignore.some((i) => file.includes(`/${i}/`))
) {
const fileStream = fs.createReadStream(file)
const rl = readline.createInterface({
input: fileStream,
Expand All @@ -41,7 +46,8 @@ async function checkFile(file) {
line.length === 0 ||
line.startsWith('#!') ||
line.startsWith('// swift-tools-version:') ||
line === bundlerLicense
line === bundlerLicense ||
line === denoLicense
) {
continue
}
Expand Down

0 comments on commit 99398f2

Please sign in to comment.