Fix license header file enumeration
This commit is contained in:
parent
c99066de9b
commit
b239502813
10 changed files with 51 additions and 13 deletions
3
.github/ISSUE_TEMPLATE/config.yml
vendored
3
.github/ISSUE_TEMPLATE/config.yml
vendored
|
@ -1,3 +1,6 @@
|
|||
# Copyright 2021 Signal Messenger, LLC
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: ✨ Feature request
|
||||
|
|
3
.github/stale.yml
vendored
3
.github/stale.yml
vendored
|
@ -1,3 +1,6 @@
|
|||
# Copyright 2021 Signal Messenger, LLC
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
# Configuration for probot-stale - https://github.com/probot/stale
|
||||
|
||||
# Number of days of inactivity before an Issue or Pull Request becomes stale
|
||||
|
|
1
.github/workflows/backport.yml
vendored
1
.github/workflows/backport.yml
vendored
|
@ -1,4 +1,3 @@
|
|||
|
||||
# Copyright 2021 Signal Messenger, LLC
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
|
|
1
aptly.sh
1
aptly.sh
|
@ -1,5 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright 2017-2021 Signal Messenger, LLC
|
||||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
/* global window */
|
||||
|
||||
// This is a hack to let us run TypeScript tests in the renderer process. See the
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
.CompositionArea {
|
||||
position: relative;
|
||||
min-height: 42px;
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
.Input {
|
||||
&__container {
|
||||
@include font-body-1;
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
@keyframes progress-animation {
|
||||
0% {
|
||||
background-position: 100%;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2020 Signal Messenger, LLC
|
||||
// Copyright 2020-2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
// This file is meant to be run frequently, so it doesn't check the license year. See the
|
||||
|
@ -8,6 +8,7 @@ import { assert } from 'chai';
|
|||
|
||||
import {
|
||||
forEachRelevantFile,
|
||||
getExtension,
|
||||
readFirstLines,
|
||||
} from '../util/lint/license_comments';
|
||||
|
||||
|
@ -17,7 +18,15 @@ describe('license comments', () => {
|
|||
this.timeout(10000);
|
||||
|
||||
await forEachRelevantFile(async file => {
|
||||
const [firstLine, secondLine] = await readFirstLines(file, 2);
|
||||
let firstLine: string;
|
||||
let secondLine: string;
|
||||
|
||||
if (getExtension(file) === '.sh') {
|
||||
const firstThreeLines = await readFirstLines(file, 3);
|
||||
[, firstLine, secondLine] = firstThreeLines;
|
||||
} else {
|
||||
[firstLine, secondLine] = await readFirstLines(file, 2);
|
||||
}
|
||||
|
||||
const { groups = {} } =
|
||||
firstLine.match(
|
||||
|
|
|
@ -14,7 +14,7 @@ import pMap from 'p-map';
|
|||
|
||||
const exec = promisify(childProcess.exec);
|
||||
|
||||
const rootPath = path.join(__dirname, '..', '..');
|
||||
const rootPath = path.join(__dirname, '..', '..', '..');
|
||||
|
||||
const EXTENSIONS_TO_CHECK = new Set([
|
||||
'.eslintignore',
|
||||
|
@ -34,15 +34,27 @@ const EXTENSIONS_TO_CHECK = new Set([
|
|||
'.md',
|
||||
'.plist',
|
||||
]);
|
||||
const FILES_TO_IGNORE = new Set([
|
||||
'ISSUE_TEMPLATE.md',
|
||||
'Mp3LameEncoder.min.js',
|
||||
'PULL_REQUEST_TEMPLATE.md',
|
||||
'WebAudioRecorderMp3.js',
|
||||
]);
|
||||
const FILES_TO_IGNORE = new Set(
|
||||
[
|
||||
'.github/ISSUE_TEMPLATE/bug_report.md',
|
||||
'.github/PULL_REQUEST_TEMPLATE.md',
|
||||
'components/indexeddb-backbonejs-adapter/backbone-indexeddb.js',
|
||||
'components/mp3lameencoder/lib/Mp3LameEncoder.js',
|
||||
'components/qrcode/qrcode.js',
|
||||
'components/recorderjs/recorder.js',
|
||||
'components/recorderjs/recorderWorker.js',
|
||||
'components/webaudiorecorder/lib/WebAudioRecorder.js',
|
||||
'components/webaudiorecorder/lib/WebAudioRecorderMp3.js',
|
||||
'js/Mp3LameEncoder.min.js',
|
||||
'js/WebAudioRecorderMp3.js',
|
||||
].map(
|
||||
// This makes sure the files are correct on Windows.
|
||||
path.normalize
|
||||
)
|
||||
);
|
||||
|
||||
// This is not technically the real extension.
|
||||
function getExtension(file: string): string {
|
||||
export function getExtension(file: string): string {
|
||||
if (file.startsWith('.')) {
|
||||
return getExtension(`x.${file}`);
|
||||
}
|
||||
|
@ -63,7 +75,8 @@ export async function forEachRelevantFile(
|
|||
await pMap(
|
||||
gitFiles,
|
||||
async (file: string) => {
|
||||
if (FILES_TO_IGNORE.has(path.basename(file))) {
|
||||
const repoPath = path.relative(rootPath, file);
|
||||
if (FILES_TO_IGNORE.has(repoPath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue