Rename new ruff rule output format to "pretty"

The new `ruff rule` output format introduced in
551b810aeb doesn't print Markdown but
rather some rich text with escape sequences for colors and links,
it's actually the "text" format that prints Markdown, so naming the new
format "markdown" is very confusing. This commit therefore renames it to
"pretty".

This isn't a breaking change since there hasn't been a release yet.
This commit is contained in:
Martin Fischer 2023-02-12 05:06:03 +01:00 committed by Charlie Marsh
parent 8289ede00f
commit f5a3c90288
3 changed files with 5 additions and 5 deletions

View file

@ -41,7 +41,7 @@ pub enum Command {
rule: Rule,
/// Output format
#[arg(long, value_enum, default_value = "markdown")]
#[arg(long, value_enum, default_value = "pretty")]
format: HelpFormat,
},
/// List all supported upstream linters
@ -284,7 +284,7 @@ pub struct CheckArgs {
pub enum HelpFormat {
Text,
Json,
Markdown,
Pretty,
}
#[allow(clippy::module_name_repetitions)]

View file

@ -64,7 +64,7 @@ pub fn linter(format: HelpFormat) -> Result<()> {
output.push('\n');
}
HelpFormat::Markdown => {
HelpFormat::Pretty => {
output.push_str(&format!("| {:>6} | {:<27} |\n", "Prefix", "Name"));
output.push_str(&format!("| {:>6} | {:<27} |\n", "------", "-".repeat(27)));

View file

@ -27,7 +27,7 @@ pub fn rule(rule: &Rule, format: HelpFormat) -> Result<()> {
let mut output = String::new();
match format {
HelpFormat::Text | HelpFormat::Markdown => {
HelpFormat::Text | HelpFormat::Pretty => {
output.push_str(&format!("# {} ({})", rule.as_ref(), rule.code()));
output.push('\n');
output.push('\n');
@ -69,7 +69,7 @@ pub fn rule(rule: &Rule, format: HelpFormat) -> Result<()> {
HelpFormat::Json | HelpFormat::Text => {
writeln!(stdout, "{output}")?;
}
HelpFormat::Markdown => {
HelpFormat::Pretty => {
let parser = Parser::new_ext(
&output,
Options::ENABLE_TASKLISTS | Options::ENABLE_STRIKETHROUGH,