Skip to content

Commit

Permalink
misc: use more inclusive and descriptive language (GoogleChrome#10949)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark authored and George Martin committed Jul 6, 2020
1 parent 3152cc2 commit c1e116c
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lighthouse-core/audits/user-timings.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class UserTimings extends Audit {
/**
* @return {Array<string>}
*/
static get blacklistedPrefixes() {
static get excludedPrefixes() {
return ['goog_'];
}

Expand All @@ -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));
}

/**
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions lighthouse-core/config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,20 +639,20 @@ 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;
}
} else if (filterByIncludedAudit) {
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) {
Expand Down
6 changes: 3 additions & 3 deletions lighthouse-core/test/audits/user-timing-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
4 changes: 2 additions & 2 deletions lighthouse-logger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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]);
Expand Down

0 comments on commit c1e116c

Please sign in to comment.