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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃搸 Add --linter to the command biome rage #1753

Closed
ematipico opened this issue Feb 5, 2024 · 3 comments 路 Fixed by #1843
Closed

馃搸 Add --linter to the command biome rage #1753

ematipico opened this issue Feb 5, 2024 · 3 comments 路 Fixed by #1843
Assignees
Labels
A-CLI Area: CLI S-Feature Status: new feature to implement S-Help-wanted Status: you're familiar with the code base and want to help the project

Comments

@ematipico
Copy link
Member

Description

We want to add a new option called --linter to the command biome rage.

The command is meant to print helpful information for us maintainers. With the --linter option, we want to print a list of the rules applied given the current configuration.

This is where the implementation should be:

pub(crate) fn rage(session: CliSession, daemon_logs: bool) -> Result<(), CliDiagnostic> {
let terminal_supports_colors = termcolor::BufferWriter::stdout(ColorChoice::Auto)
.buffer()
.supports_color();
session.app.console.log(markup!("CLI:\n"
{KeyValuePair("Version", markup!({VERSION}))}
{KeyValuePair("Color support", markup!({DebugDisplay(terminal_supports_colors)}))}
{Section("Platform")}
{KeyValuePair("CPU Architecture", markup!({std::env::consts::ARCH}))}
{KeyValuePair("OS", markup!({std::env::consts::OS}))}
{Section("Environment")}
{EnvVarOs("BIOME_LOG_DIR")}
{EnvVarOs("NO_COLOR")}
{EnvVarOs("TERM")}
{EnvVarOs("JS_RUNTIME_VERSION")}
{EnvVarOs("JS_RUNTIME_NAME")}
{EnvVarOs("NODE_PACKAGE_MANAGER")}
{RageConfiguration(&session.app.fs)}
{WorkspaceRage(session.app.workspace.deref())}
));
if daemon_logs {
match session.app.workspace.server_info() {
Some(_) => {
session.app.console.log(markup!({
ConnectedClientServerLog(session.app.workspace.deref())
}));
}
None => {
session
.app
.console
.log(markup!("Discovering running Biome servers..."));
session.app.console.log(markup!({ RunningRomeServer }));
}
}
}
Ok(())
}

@ematipico ematipico added S-Help-wanted Status: you're familiar with the code base and want to help the project A-CLI Area: CLI S-Feature Status: new feature to implement labels Feb 5, 2024
@seitarof
Copy link
Contributor

@ematipico
I'm thinking of working on this.
If possible, I would appreciate it if you could provide an example of the output.

@ematipico
Copy link
Member Author

@ematipico
I'm thinking of working on this.
If possible, I would appreciate it if you could provide an example of the output.

Nothing fancy, just a list like:

noDebugger = error
useConst = off

I think that's a good start, then we can improve it once we have something

@seitarof
Copy link
Contributor

@ematipico
I understand. Could you assigned me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: CLI S-Feature Status: new feature to implement S-Help-wanted Status: you're familiar with the code base and want to help the project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants