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
|
blank_issues_enabled: false
|
||||||
contact_links:
|
contact_links:
|
||||||
- name: ✨ Feature request
|
- 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
|
# Configuration for probot-stale - https://github.com/probot/stale
|
||||||
|
|
||||||
# Number of days of inactivity before an Issue or Pull Request becomes 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
|
# Copyright 2021 Signal Messenger, LLC
|
||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
# SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
|
|
1
aptly.sh
1
aptly.sh
|
@ -1,5 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Copyright 2017-2021 Signal Messenger, LLC
|
# Copyright 2017-2021 Signal Messenger, LLC
|
||||||
# SPDX-License-Identifier: AGPL-3.0-only
|
# 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 */
|
/* global window */
|
||||||
|
|
||||||
// This is a hack to let us run TypeScript tests in the renderer process. See the
|
// 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 {
|
.CompositionArea {
|
||||||
position: relative;
|
position: relative;
|
||||||
min-height: 42px;
|
min-height: 42px;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright 2021 Signal Messenger, LLC
|
||||||
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
.Input {
|
.Input {
|
||||||
&__container {
|
&__container {
|
||||||
@include font-body-1;
|
@include font-body-1;
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright 2021 Signal Messenger, LLC
|
||||||
|
// SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
@keyframes progress-animation {
|
@keyframes progress-animation {
|
||||||
0% {
|
0% {
|
||||||
background-position: 100%;
|
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
|
// 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
|
// 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 {
|
import {
|
||||||
forEachRelevantFile,
|
forEachRelevantFile,
|
||||||
|
getExtension,
|
||||||
readFirstLines,
|
readFirstLines,
|
||||||
} from '../util/lint/license_comments';
|
} from '../util/lint/license_comments';
|
||||||
|
|
||||||
|
@ -17,7 +18,15 @@ describe('license comments', () => {
|
||||||
this.timeout(10000);
|
this.timeout(10000);
|
||||||
|
|
||||||
await forEachRelevantFile(async file => {
|
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 = {} } =
|
const { groups = {} } =
|
||||||
firstLine.match(
|
firstLine.match(
|
||||||
|
|
|
@ -14,7 +14,7 @@ import pMap from 'p-map';
|
||||||
|
|
||||||
const exec = promisify(childProcess.exec);
|
const exec = promisify(childProcess.exec);
|
||||||
|
|
||||||
const rootPath = path.join(__dirname, '..', '..');
|
const rootPath = path.join(__dirname, '..', '..', '..');
|
||||||
|
|
||||||
const EXTENSIONS_TO_CHECK = new Set([
|
const EXTENSIONS_TO_CHECK = new Set([
|
||||||
'.eslintignore',
|
'.eslintignore',
|
||||||
|
@ -34,15 +34,27 @@ const EXTENSIONS_TO_CHECK = new Set([
|
||||||
'.md',
|
'.md',
|
||||||
'.plist',
|
'.plist',
|
||||||
]);
|
]);
|
||||||
const FILES_TO_IGNORE = new Set([
|
const FILES_TO_IGNORE = new Set(
|
||||||
'ISSUE_TEMPLATE.md',
|
[
|
||||||
'Mp3LameEncoder.min.js',
|
'.github/ISSUE_TEMPLATE/bug_report.md',
|
||||||
'PULL_REQUEST_TEMPLATE.md',
|
'.github/PULL_REQUEST_TEMPLATE.md',
|
||||||
'WebAudioRecorderMp3.js',
|
'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.
|
// This is not technically the real extension.
|
||||||
function getExtension(file: string): string {
|
export function getExtension(file: string): string {
|
||||||
if (file.startsWith('.')) {
|
if (file.startsWith('.')) {
|
||||||
return getExtension(`x.${file}`);
|
return getExtension(`x.${file}`);
|
||||||
}
|
}
|
||||||
|
@ -63,7 +75,8 @@ export async function forEachRelevantFile(
|
||||||
await pMap(
|
await pMap(
|
||||||
gitFiles,
|
gitFiles,
|
||||||
async (file: string) => {
|
async (file: string) => {
|
||||||
if (FILES_TO_IGNORE.has(path.basename(file))) {
|
const repoPath = path.relative(rootPath, file);
|
||||||
|
if (FILES_TO_IGNORE.has(repoPath)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue