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

Added description for experiments:list command #6363

Merged
merged 1 commit into from
Sep 15, 2023
Merged
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
40 changes: 22 additions & 18 deletions src/commands/experiments-list.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
import { Command } from "../command";
const Table = require("cli-table");

Check warning on line 2 in src/commands/experiments-list.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe assignment of an `any` value

Check warning on line 2 in src/commands/experiments-list.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Require statement not part of import statement
import * as experiments from "../experiments";
import { partition } from "../functional";
import { logger } from "../logger";

export const command = new Command("experiments:list").action(() => {
const table = new Table({
head: ["Enabled", "Name", "Description"],
style: { head: ["yellow"] },
});
const [enabled, disabled] = partition(Object.entries(experiments.ALL_EXPERIMENTS), ([name]) => {
return experiments.isEnabled(name as experiments.ExperimentName);
});
for (const [name, exp] of enabled) {
table.push(["y", name, exp.shortDescription]);
}
for (const [name, exp] of disabled) {
if (!exp.public) {
continue;
export const command = new Command("experiments:list")
.description(
"list all experiments, along with a description of each experiment and whether it is currently enabled"
)
.action(() => {
const table = new Table({

Check warning on line 12 in src/commands/experiments-list.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe assignment of an `any` value

Check warning on line 12 in src/commands/experiments-list.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe construction of an any type value
head: ["Enabled", "Name", "Description"],
style: { head: ["yellow"] },
});
const [enabled, disabled] = partition(Object.entries(experiments.ALL_EXPERIMENTS), ([name]) => {
return experiments.isEnabled(name as experiments.ExperimentName);
});
for (const [name, exp] of enabled) {
table.push(["y", name, exp.shortDescription]);

Check warning on line 20 in src/commands/experiments-list.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe member access .push on an `any` value

Check warning on line 20 in src/commands/experiments-list.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe call of an `any` typed value
}
table.push(["n", name, exp.shortDescription]);
}
logger.info(table.toString());
});
for (const [name, exp] of disabled) {
if (!exp.public) {
continue;
}
table.push(["n", name, exp.shortDescription]);

Check warning on line 26 in src/commands/experiments-list.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe member access .push on an `any` value

Check warning on line 26 in src/commands/experiments-list.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe call of an `any` typed value
}
logger.info(table.toString());

Check warning on line 28 in src/commands/experiments-list.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe argument of type `any` assigned to a parameter of type `Error`

Check warning on line 28 in src/commands/experiments-list.ts

View workflow job for this annotation

GitHub Actions / lint (18)

Unsafe member access .toString on an `any` value
});
Loading