mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
build: disable license fixer (#11768)
This commit is contained in:
parent
96b7af5988
commit
a91a9e1aa4
@ -13,13 +13,13 @@ const createRule = ESLintUtils.RuleCreator(name => {
|
|||||||
|
|
||||||
const copyrightPattern = /Copyright ([0-9]{4}) Google Inc\./;
|
const copyrightPattern = /Copyright ([0-9]{4}) Google Inc\./;
|
||||||
|
|
||||||
const currentYear = new Date().getFullYear;
|
// const currentYear = new Date().getFullYear;
|
||||||
|
|
||||||
const licenseHeader = `/**
|
// const licenseHeader = `/**
|
||||||
* @license
|
// * @license
|
||||||
* Copyright ${currentYear} Google Inc.
|
// * Copyright ${currentYear} Google Inc.
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
// * SPDX-License-Identifier: Apache-2.0
|
||||||
*/`;
|
// */`;
|
||||||
|
|
||||||
const enforceLicenseRule = createRule<[], 'licenseRule'>({
|
const enforceLicenseRule = createRule<[], 'licenseRule'>({
|
||||||
name: 'check-license',
|
name: 'check-license',
|
||||||
@ -29,7 +29,7 @@ const enforceLicenseRule = createRule<[], 'licenseRule'>({
|
|||||||
description: 'Validate existence of license header',
|
description: 'Validate existence of license header',
|
||||||
requiresTypeChecking: false,
|
requiresTypeChecking: false,
|
||||||
},
|
},
|
||||||
fixable: 'code',
|
fixable: undefined, // TODO: change to 'code' once fixer works.
|
||||||
schema: [],
|
schema: [],
|
||||||
messages: {
|
messages: {
|
||||||
licenseRule: 'Add license header.',
|
licenseRule: 'Add license header.',
|
||||||
@ -65,13 +65,14 @@ const enforceLicenseRule = createRule<[], 'licenseRule'>({
|
|||||||
|
|
||||||
// Add header license
|
// Add header license
|
||||||
if (!header || !header.value.includes('@license')) {
|
if (!header || !header.value.includes('@license')) {
|
||||||
const startLoc: [number, number] = [0, 88];
|
// const startLoc: [number, number] = [0, 88];
|
||||||
context.report({
|
context.report({
|
||||||
node: node,
|
node: node,
|
||||||
messageId: 'licenseRule',
|
messageId: 'licenseRule',
|
||||||
fix(fixer) {
|
// TODO: fix the fixer.
|
||||||
return fixer.insertTextBeforeRange(startLoc, licenseHeader);
|
// fix(fixer) {
|
||||||
},
|
// return fixer.insertTextBeforeRange(startLoc, licenseHeader);
|
||||||
|
// },
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user