Skip to content
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
11 changes: 6 additions & 5 deletions crates/xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@ use clap::{Args, Parser, Subcommand, arg};
use codegen::codegen;
use new_rule::new_lint;
use sync_kwlist::sync_kwlist;
use sync_regression_suite::sync_regression_suite;

mod codegen;
mod download_regression_tests;
mod keywords;
mod new_rule;
mod path;
mod sync_kwlist;
mod sync_regression_suite;

#[derive(Subcommand, Debug)]
enum TaskName {
#[command(long_about = "Generate code for AST, SyntaxKind, and TokenSets.")]
#[command(long_about = "Generate code for AST, SyntaxKind, and TokenSets")]
Codegen,
#[command(long_about = "Fetch the latest version of kwlist.h from Postgres")]
SyncKwlist,
#[command(long_about = "Create a new linter rule")]
NewRule(NewRuleArgs),
#[command(long_about = "Download and process regression tests from Postgres")]
DownloadRegressionTests,
#[command(long_about = "Fetch the latest regression suite from Postgres")]
SyncRegressionSuite,
}

#[derive(Args, Debug)]
Expand All @@ -42,8 +43,8 @@ fn main() -> Result<()> {
let args = Arguments::parse();
match args.task {
TaskName::SyncKwlist => sync_kwlist(),
TaskName::SyncRegressionSuite => sync_regression_suite(),
TaskName::NewRule(args) => new_lint(args),
TaskName::Codegen => codegen(),
TaskName::DownloadRegressionTests => download_regression_tests::download_regression_tests(),
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const GSET_REPLACEMENTS: &[(&str, &str)] = &[
),
];

pub(crate) fn download_regression_tests() -> Result<()> {
pub(crate) fn sync_regression_suite() -> Result<()> {
let temp_dir = download_regression_suite()?;
transform_regression_suite(&temp_dir)?;
Ok(())
Expand Down
Loading