mirror of
https://github.com/actions/labeler.git
synced 2025-12-12 12:37:48 +00:00
Adjust the indenting again
This commit is contained in:
32
dist/index.js
vendored
32
dist/index.js
vendored
@@ -66,7 +66,7 @@ exports.getBranchName = getBranchName;
|
|||||||
function checkAnyBranch(regexps, branchBase) {
|
function checkAnyBranch(regexps, branchBase) {
|
||||||
const branchName = getBranchName(branchBase);
|
const branchName = getBranchName(branchBase);
|
||||||
if (!branchName) {
|
if (!branchName) {
|
||||||
core.debug(` no branch name`);
|
core.debug(` no branch name`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
core.debug(` checking "branch" pattern against ${branchName}`);
|
core.debug(` checking "branch" pattern against ${branchName}`);
|
||||||
@@ -84,7 +84,7 @@ exports.checkAnyBranch = checkAnyBranch;
|
|||||||
function checkAllBranch(regexps, branchBase) {
|
function checkAllBranch(regexps, branchBase) {
|
||||||
const branchName = getBranchName(branchBase);
|
const branchName = getBranchName(branchBase);
|
||||||
if (!branchName) {
|
if (!branchName) {
|
||||||
core.debug(` no branch name`);
|
core.debug(` no branch name`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
core.debug(` checking "branch" pattern against ${branchName}`);
|
core.debug(` checking "branch" pattern against ${branchName}`);
|
||||||
@@ -187,38 +187,38 @@ function printPattern(matcher) {
|
|||||||
return (matcher.negate ? '!' : '') + matcher.pattern;
|
return (matcher.negate ? '!' : '') + matcher.pattern;
|
||||||
}
|
}
|
||||||
function isAnyMatch(changedFile, matchers) {
|
function isAnyMatch(changedFile, matchers) {
|
||||||
core.debug(` matching patterns against file ${changedFile}`);
|
core.debug(` matching patterns against file ${changedFile}`);
|
||||||
for (const matcher of matchers) {
|
for (const matcher of matchers) {
|
||||||
core.debug(` - ${printPattern(matcher)}`);
|
core.debug(` - ${printPattern(matcher)}`);
|
||||||
if (matcher.match(changedFile)) {
|
if (matcher.match(changedFile)) {
|
||||||
core.debug(` ${printPattern(matcher)} matched`);
|
core.debug(` ${printPattern(matcher)} matched`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
core.debug(` no patterns matched`);
|
core.debug(` no patterns matched`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
function isAllMatch(changedFile, matchers) {
|
function isAllMatch(changedFile, matchers) {
|
||||||
core.debug(` matching patterns against file ${changedFile}`);
|
core.debug(` matching patterns against file ${changedFile}`);
|
||||||
for (const matcher of matchers) {
|
for (const matcher of matchers) {
|
||||||
core.debug(` - ${printPattern(matcher)}`);
|
core.debug(` - ${printPattern(matcher)}`);
|
||||||
if (!matcher.match(changedFile)) {
|
if (!matcher.match(changedFile)) {
|
||||||
core.debug(` ${printPattern(matcher)} did not match`);
|
core.debug(` ${printPattern(matcher)} did not match`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
core.debug(` all patterns matched`);
|
core.debug(` all patterns matched`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
function checkAnyChangedFiles(changedFiles, globs) {
|
function checkAnyChangedFiles(changedFiles, globs) {
|
||||||
const matchers = globs.map(g => new minimatch_1.Minimatch(g));
|
const matchers = globs.map(g => new minimatch_1.Minimatch(g));
|
||||||
for (const changedFile of changedFiles) {
|
for (const changedFile of changedFiles) {
|
||||||
if (isAnyMatch(changedFile, matchers)) {
|
if (isAnyMatch(changedFile, matchers)) {
|
||||||
core.debug(` "any" patterns matched against ${changedFile}`);
|
core.debug(` "any" patterns matched against ${changedFile}`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
core.debug(` "any" patterns did not match any files`);
|
core.debug(` "any" patterns did not match any files`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
exports.checkAnyChangedFiles = checkAnyChangedFiles;
|
exports.checkAnyChangedFiles = checkAnyChangedFiles;
|
||||||
@@ -226,11 +226,11 @@ function checkAllChangedFiles(changedFiles, globs) {
|
|||||||
const matchers = globs.map(g => new minimatch_1.Minimatch(g));
|
const matchers = globs.map(g => new minimatch_1.Minimatch(g));
|
||||||
for (const changedFile of changedFiles) {
|
for (const changedFile of changedFiles) {
|
||||||
if (!isAllMatch(changedFile, matchers)) {
|
if (!isAllMatch(changedFile, matchers)) {
|
||||||
core.debug(` "all" patterns did not match against ${changedFile}`);
|
core.debug(` "all" patterns did not match against ${changedFile}`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
core.debug(` "all" patterns matched all files`);
|
core.debug(` "all" patterns matched all files`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
exports.checkAllChangedFiles = checkAllChangedFiles;
|
exports.checkAllChangedFiles = checkAllChangedFiles;
|
||||||
@@ -467,7 +467,7 @@ function checkAny(matchConfigs, changedFiles) {
|
|||||||
exports.checkAny = checkAny;
|
exports.checkAny = checkAny;
|
||||||
// equivalent to "Array.every()" but expanded for debugging and clarity
|
// equivalent to "Array.every()" but expanded for debugging and clarity
|
||||||
function checkAll(matchConfigs, changedFiles) {
|
function checkAll(matchConfigs, changedFiles) {
|
||||||
core.debug(` checking "all" patterns`);
|
core.debug(` checking "all" patterns`);
|
||||||
if (!Object.keys(matchConfigs).length) {
|
if (!Object.keys(matchConfigs).length) {
|
||||||
core.debug(` no "all" patterns to check`);
|
core.debug(` no "all" patterns to check`);
|
||||||
return false;
|
return false;
|
||||||
@@ -489,7 +489,7 @@ function checkAll(matchConfigs, changedFiles) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
core.debug(` "all" patterns matched all files`);
|
core.debug(` "all" patterns matched all configs`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
exports.checkAll = checkAll;
|
exports.checkAll = checkAll;
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ export function checkAnyBranch(
|
|||||||
): boolean {
|
): boolean {
|
||||||
const branchName = getBranchName(branchBase);
|
const branchName = getBranchName(branchBase);
|
||||||
if (!branchName) {
|
if (!branchName) {
|
||||||
core.debug(` no branch name`);
|
core.debug(` no branch name`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ export function checkAllBranch(
|
|||||||
): boolean {
|
): boolean {
|
||||||
const branchName = getBranchName(branchBase);
|
const branchName = getBranchName(branchBase);
|
||||||
if (!branchName) {
|
if (!branchName) {
|
||||||
core.debug(` no branch name`);
|
core.debug(` no branch name`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,30 +50,30 @@ function printPattern(matcher: Minimatch): string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isAnyMatch(changedFile: string, matchers: Minimatch[]): boolean {
|
function isAnyMatch(changedFile: string, matchers: Minimatch[]): boolean {
|
||||||
core.debug(` matching patterns against file ${changedFile}`);
|
core.debug(` matching patterns against file ${changedFile}`);
|
||||||
for (const matcher of matchers) {
|
for (const matcher of matchers) {
|
||||||
core.debug(` - ${printPattern(matcher)}`);
|
core.debug(` - ${printPattern(matcher)}`);
|
||||||
if (matcher.match(changedFile)) {
|
if (matcher.match(changedFile)) {
|
||||||
core.debug(` ${printPattern(matcher)} matched`);
|
core.debug(` ${printPattern(matcher)} matched`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
core.debug(` no patterns matched`);
|
core.debug(` no patterns matched`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function isAllMatch(changedFile: string, matchers: Minimatch[]): boolean {
|
function isAllMatch(changedFile: string, matchers: Minimatch[]): boolean {
|
||||||
core.debug(` matching patterns against file ${changedFile}`);
|
core.debug(` matching patterns against file ${changedFile}`);
|
||||||
for (const matcher of matchers) {
|
for (const matcher of matchers) {
|
||||||
core.debug(` - ${printPattern(matcher)}`);
|
core.debug(` - ${printPattern(matcher)}`);
|
||||||
if (!matcher.match(changedFile)) {
|
if (!matcher.match(changedFile)) {
|
||||||
core.debug(` ${printPattern(matcher)} did not match`);
|
core.debug(` ${printPattern(matcher)} did not match`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
core.debug(` all patterns matched`);
|
core.debug(` all patterns matched`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,12 +84,12 @@ export function checkAnyChangedFiles(
|
|||||||
const matchers = globs.map(g => new Minimatch(g));
|
const matchers = globs.map(g => new Minimatch(g));
|
||||||
for (const changedFile of changedFiles) {
|
for (const changedFile of changedFiles) {
|
||||||
if (isAnyMatch(changedFile, matchers)) {
|
if (isAnyMatch(changedFile, matchers)) {
|
||||||
core.debug(` "any" patterns matched against ${changedFile}`);
|
core.debug(` "any" patterns matched against ${changedFile}`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
core.debug(` "any" patterns did not match any files`);
|
core.debug(` "any" patterns did not match any files`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,11 +100,11 @@ export function checkAllChangedFiles(
|
|||||||
const matchers = globs.map(g => new Minimatch(g));
|
const matchers = globs.map(g => new Minimatch(g));
|
||||||
for (const changedFile of changedFiles) {
|
for (const changedFile of changedFiles) {
|
||||||
if (!isAllMatch(changedFile, matchers)) {
|
if (!isAllMatch(changedFile, matchers)) {
|
||||||
core.debug(` "all" patterns did not match against ${changedFile}`);
|
core.debug(` "all" patterns did not match against ${changedFile}`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
core.debug(` "all" patterns matched all files`);
|
core.debug(` "all" patterns matched all files`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -260,7 +260,7 @@ export function checkAll(
|
|||||||
matchConfigs: BaseMatchConfig[],
|
matchConfigs: BaseMatchConfig[],
|
||||||
changedFiles: string[]
|
changedFiles: string[]
|
||||||
): boolean {
|
): boolean {
|
||||||
core.debug(` checking "all" patterns`);
|
core.debug(` checking "all" patterns`);
|
||||||
if (!Object.keys(matchConfigs).length) {
|
if (!Object.keys(matchConfigs).length) {
|
||||||
core.debug(` no "all" patterns to check`);
|
core.debug(` no "all" patterns to check`);
|
||||||
return false;
|
return false;
|
||||||
@@ -286,7 +286,7 @@ export function checkAll(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
core.debug(` "all" patterns matched all files`);
|
core.debug(` "all" patterns matched all configs`);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user