Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: remove --print-config #14585

Merged
merged 4 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions cli/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ import * as commands from './commands/commands.js';
import * as Printer from './printer.js';
import {getFlags} from './cli-flags.js';
import {runLighthouse} from './run.js';
import {generateConfig, generateLegacyConfig} from '../core/index.js';
import {askPermission} from './sentry-prompt.js';
import {LH_ROOT} from '../root.js';
import {Sentry} from '../core/lib/sentry.js';
import {getConfigDisplayString} from '../core/config/config.js';

const pkg = JSON.parse(fs.readFileSync(LH_ROOT + '/package.json', 'utf-8'));

Expand Down Expand Up @@ -116,17 +114,6 @@ async function begin() {
cliFlags.precomputedLanternData = data;
}

if (cliFlags.printConfig) {
if (cliFlags.legacyNavigation) {
const config = await generateLegacyConfig(configJson, cliFlags);
process.stdout.write(config.getPrintString());
} else {
const config = await generateConfig(configJson, cliFlags);
process.stdout.write(getConfigDisplayString(config));
}
return;
}

// By default, cliFlags.enableErrorReporting is undefined so the user is
// prompted. This can be overriden with an explicit flag or by the cached
// answer returned by askPermission().
Expand Down
9 changes: 2 additions & 7 deletions cli/cli-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,6 @@ function getYargsParser(manualArgv) {
default: false,
describe: 'Prints a list of all required trace categories and exits',
},
'print-config': {
type: 'boolean',
default: false,
describe: 'Print the normalized config for the given config and options, then exit.',
},
'debug-navigation': {
type: 'boolean',
describe: 'Pause after page load to wait for permission to continue the run, evaluate `continueLighthouseRun` in the console to continue.',
Expand Down Expand Up @@ -212,7 +207,7 @@ function getYargsParser(manualArgv) {
},
})
.group([
'save-assets', 'list-all-audits', 'list-locales', 'list-trace-categories', 'print-config', 'additional-trace-categories',
'save-assets', 'list-all-audits', 'list-locales', 'list-trace-categories', 'additional-trace-categories',
'config-path', 'preset', 'chrome-flags', 'port', 'hostname', 'form-factor', 'screenEmulation', 'emulatedUserAgent',
'max-wait-for-load', 'enable-error-reporting', 'gather-mode', 'audit-mode',
'only-audits', 'only-categories', 'skip-audits', 'budget-path',
Expand Down Expand Up @@ -317,7 +312,7 @@ Example: --output-path=./lighthouse-results.html`,
// - We're just printing the config.
// - We're in auditMode (and we have artifacts already)
// If one of these don't apply, if no URL, stop the program and ask for one.
const isPrintSomethingMode = argv.listAllAudits || argv.listLocales || argv.listTraceCategories || argv.printConfig;
const isPrintSomethingMode = argv.listAllAudits || argv.listLocales || argv.listTraceCategories;
const isOnlyAuditMode = !!argv.auditMode && !argv.gatherMode;
if (isPrintSomethingMode || isOnlyAuditMode) {
return true;
Expand Down
20 changes: 0 additions & 20 deletions cli/test/cli/__snapshots__/cli-flags-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ Object {
"html",
],
"port": 0,
"print-config": false,
"printConfig": false,
"quiet": false,
"save-assets": false,
"saveAssets": false,
Expand Down Expand Up @@ -78,8 +76,6 @@ Object {
"html",
],
"port": 0,
"print-config": false,
"printConfig": false,
"quiet": false,
"save-assets": false,
"saveAssets": false,
Expand Down Expand Up @@ -128,8 +124,6 @@ Object {
"html",
],
"port": 0,
"print-config": false,
"printConfig": false,
"quiet": false,
"save-assets": false,
"saveAssets": false,
Expand Down Expand Up @@ -170,8 +164,6 @@ Object {
"html",
],
"port": 0,
"print-config": false,
"printConfig": false,
"quiet": false,
"save-assets": false,
"saveAssets": false,
Expand Down Expand Up @@ -204,8 +196,6 @@ Object {
"html",
],
"port": 0,
"print-config": false,
"printConfig": false,
"quiet": false,
"save-assets": false,
"saveAssets": false,
Expand Down Expand Up @@ -252,8 +242,6 @@ Object {
"html",
],
"port": 0,
"print-config": false,
"printConfig": false,
"quiet": false,
"save-assets": false,
"saveAssets": false,
Expand Down Expand Up @@ -300,8 +288,6 @@ Object {
"html",
],
"port": 0,
"print-config": false,
"printConfig": false,
"quiet": false,
"save-assets": false,
"saveAssets": false,
Expand Down Expand Up @@ -348,8 +334,6 @@ Object {
"html",
],
"port": 0,
"print-config": false,
"printConfig": false,
"quiet": false,
"save-assets": false,
"saveAssets": false,
Expand Down Expand Up @@ -403,8 +387,6 @@ Object {
"html",
],
"port": 0,
"print-config": false,
"printConfig": false,
"quiet": false,
"save-assets": false,
"saveAssets": false,
Expand Down Expand Up @@ -457,8 +439,6 @@ Object {
"html",
],
"port": 0,
"print-config": false,
"printConfig": false,
"quiet": false,
"save-assets": false,
"saveAssets": false,
Expand Down
Loading