diff --git a/changelog.md b/changelog.md index 8277e1b9980e..82209369c1d1 100644 --- a/changelog.md +++ b/changelog.md @@ -2654,7 +2654,7 @@ Since 2.1.0 we've had a number of other features, fixes, and improvements. Prese #### Configurability -* feat(config): add audit blacklist support (#2499) +* feat(config): add audit skipping support (#2499) * feat(config): add extends lighthouse:full (#2557) * docs(config): add config documentation (#2592) @@ -2836,7 +2836,7 @@ Huge thanks to who contributed 27 epic PRs. ## Misc * 07e0aab1 Remove recordNetwork from config (#2102) -* 16b0b048 feat: support Config category and audit whitelisting (#1988) +* 16b0b048 feat: support Config running only specified categories or audits (#1988) * b2ccdfcb Allow opn & update-notifier CLI deps to be optional. (#2150) * 283af871 dismiss any Javascript Dialogs automatically (#1939) (#2106) * e475bdb5 refactor(aggregations): switch usage of aggregations to categories (#1935) diff --git a/docs/configuration.md b/docs/configuration.md index f6a692adbb6f..cc55976920e3 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -59,7 +59,7 @@ The extends property controls if your configuration should inherit from the defa ### `settings: Object|undefined` -The settings property controls various aspects of running Lighthouse such as CPU/network throttling and audit whitelisting/blacklisting. +The settings property controls various aspects of running Lighthouse such as CPU/network throttling and which audits should run. #### Example ```js diff --git a/lighthouse-core/audits/user-timings.js b/lighthouse-core/audits/user-timings.js index e85f18edb393..a419b29c6077 100644 --- a/lighthouse-core/audits/user-timings.js +++ b/lighthouse-core/audits/user-timings.js @@ -47,7 +47,7 @@ class UserTimings extends Audit { /** * @return {Array} */ - static get blacklistedPrefixes() { + static get excludedPrefixes() { return ['goog_']; } @@ -56,8 +56,8 @@ class UserTimings extends Audit { * @param {MarkEvent|MeasureEvent} evt * @return {boolean} */ - static excludeBlacklisted(evt) { - return UserTimings.blacklistedPrefixes.every(prefix => !evt.name.startsWith(prefix)); + static excludeEvent(evt) { + return UserTimings.excludedPrefixes.every(prefix => !evt.name.startsWith(prefix)); } /** @@ -68,7 +68,7 @@ class UserTimings extends Audit { static audit(artifacts, context) { const trace = artifacts.traces[Audit.DEFAULT_PASS]; return ComputedUserTimings.request(trace, context).then(computedUserTimings => { - const userTimings = computedUserTimings.filter(UserTimings.excludeBlacklisted); + const userTimings = computedUserTimings.filter(UserTimings.excludeEvent); const tableRows = userTimings.map(item => { return { name: item.name, diff --git a/lighthouse-core/config/config.js b/lighthouse-core/config/config.js index 5c1a416f0dbf..7c5e46efe3c2 100644 --- a/lighthouse-core/config/config.js +++ b/lighthouse-core/config/config.js @@ -639,12 +639,12 @@ class Config { const category = deepClone(oldCategories[categoryId]); if (filterByIncludedCategory && filterByIncludedAudit) { - // If we're filtering to the category and audit whitelist, include the union of the two + // If we're filtering by category and audit, include the union of the two if (!categoryIds.includes(categoryId)) { category.auditRefs = category.auditRefs.filter(audit => auditIds.includes(audit.id)); } } else if (filterByIncludedCategory) { - // If we're filtering to just the category whitelist and the category is not included, skip it + // If we're filtering by just category, and the category is not included, skip it if (!categoryIds.includes(categoryId)) { return; } @@ -652,7 +652,7 @@ class Config { category.auditRefs = category.auditRefs.filter(audit => auditIds.includes(audit.id)); } - // always filter to the audit blacklist + // always filter based on skipAuditIds category.auditRefs = category.auditRefs.filter(audit => !skipAuditIds.includes(audit.id)); if (category.auditRefs.length) { diff --git a/lighthouse-core/test/audits/user-timing-test.js b/lighthouse-core/test/audits/user-timing-test.js index 6a1a92ec4c07..d12ee5a68ae9 100644 --- a/lighthouse-core/test/audits/user-timing-test.js +++ b/lighthouse-core/test/audits/user-timing-test.js @@ -22,10 +22,10 @@ describe('Performance: user-timings audit', () => { it('evaluates valid input correctly', () => { const artifacts = generateArtifactsWithTrace(traceEvents); return UserTimingsAudit.audit(artifacts, {computedCache: new Map()}).then(auditResult => { - const blackListedUTs = auditResult.extendedInfo.value.filter(timing => { - return UserTimingsAudit.blacklistedPrefixes.some(prefix => timing.name.startsWith(prefix)); + const excludedUTs = auditResult.extendedInfo.value.filter(timing => { + return UserTimingsAudit.excludedPrefixes.some(prefix => timing.name.startsWith(prefix)); }); - assert.equal(blackListedUTs.length, 0, 'Blacklisted usertimings included in results'); + assert.equal(excludedUTs.length, 0, 'excluded usertimings included in results'); assert.equal(auditResult.score, 0); expect(auditResult.displayValue).toBeDisplayString('2 user timings'); diff --git a/lighthouse-logger/index.js b/lighthouse-logger/index.js index c71d06562e29..7ae6ea5a556e 100644 --- a/lighthouse-logger/index.js +++ b/lighthouse-logger/index.js @@ -23,7 +23,7 @@ const colors = { magenta: isBrowser ? 'palevioletred' : 5, }; -// whitelist non-red/yellow colors for debug() +// allow non-red/yellow colors for debug() debug.colors = [colors.cyan, colors.green, colors.blue, colors.magenta]; class Emitter extends EventEmitter { @@ -105,7 +105,7 @@ class Log { const columns = (!process || process.browser) ? Infinity : process.stdout.columns; const method = data.method || '?????'; const maxLength = columns - method.length - prefix.length - loggingBufferColumns; - // IO.read blacklisted here to avoid logging megabytes of trace data + // IO.read ignored here to avoid logging megabytes of trace data const snippet = (data.params && method !== 'IO.read') ? JSON.stringify(data.params).substr(0, maxLength) : ''; Log._logToStdErr(`${prefix}:${level || ''}`, [method, snippet]);