Fix license header file enumeration

This commit is contained in:
Evan Hahn 2021-10-01 16:52:36 -05:00 committed by GitHub
parent c99066de9b
commit b239502813
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 51 additions and 13 deletions

View File

@ -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
View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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%;

View File

@ -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(

View File

@ -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;
} }