Skip to content

Commit 0ddba19

Browse files
committed
refactor(configuration): cleanup codegen and make RuleSelector generic
1 parent b40b276 commit 0ddba19

File tree

13 files changed

+914
-845
lines changed

13 files changed

+914
-845
lines changed

crates/pgls_cli/src/commands/mod.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::cli_options::{CliOptions, CliReporter, ColorsArg, cli_options};
33
use crate::logging::LoggingKind;
44
use crate::{CliDiagnostic, LoggingLevel, VERSION};
55
use bpaf::Bpaf;
6-
use pgls_configuration::{PartialConfiguration, partial_configuration};
6+
use pgls_configuration::{PartialConfiguration, RuleSelector, partial_configuration};
77
use pgls_fs::FileSystem;
88
use pgls_workspace::DynRef;
99
use std::ffi::OsString;
@@ -69,6 +69,14 @@ pub enum PgLSCommand {
6969
/// Single file, single path or list of paths
7070
#[bpaf(positional("PATH"), many)]
7171
paths: Vec<OsString>,
72+
73+
/// When provided, only the specified groups or rules will be executed.
74+
#[bpaf(long("only"), argument("GROUP|RULE"))]
75+
only: Vec<RuleSelector>,
76+
77+
/// When provided, the specified groups or rules will be skipped during execution.
78+
#[bpaf(long("skip"), argument("GROUP|RULE"))]
79+
skip: Vec<RuleSelector>,
7280
},
7381

7482
/// Starts the daemon server process.

crates/pgls_cli/src/execute/process_file/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ pub(crate) fn check_with_guard<'ctx>(
3131

3232
let pull_diagnostics_result = workspace_file
3333
.guard()
34-
.pull_diagnostics(
34+
.pull_file_diagnostics(
3535
RuleCategoriesBuilder::default().all().build(),
3636
max_diagnostics,
3737
only,

0 commit comments

Comments
 (0)