Skip to content

Commit 99c2264

Browse files
committed
progress
1 parent 3f04408 commit 99c2264

File tree

5 files changed

+13
-6
lines changed

5 files changed

+13
-6
lines changed

crates/pgt_cli/src/commands/check.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@ use pgt_fs::FileSystem;
1111
use pgt_workspace::DynRef;
1212
use std::ffi::OsString;
1313

14-
#[allow(dead_code)]
1514
pub struct CheckArgs {
1615
pub configuration: Option<PartialConfiguration>,
1716
pub paths: Vec<OsString>,
1817
pub stdin_file_path: Option<String>,
1918
pub staged: bool,
2019
pub changed: bool,
2120
pub since: Option<String>,
22-
pub apply: bool,
23-
pub apply_unsafe: bool,
2421
}
2522

2623
pub fn check(

crates/pgt_cli/src/execute/process_file/workspace_file.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,11 @@ use std::path::{Path, PathBuf};
99
/// Small wrapper that holds information and operations around the current processed file
1010
pub(crate) struct WorkspaceFile<'ctx, 'app> {
1111
guard: FileGuard<'app, dyn Workspace + 'ctx>,
12+
/// File handle for the underlying filesystem entry, if backed by a real file.
13+
/// Not present for stdin execution where content is provided as a temporary buffer.
14+
/// Currently unused but will be needed when autofix/write operations are implemented.
1215
#[allow(dead_code)]
13-
file: Option<Box<dyn File>>, // only present when backed by a real fs entry
16+
file: Option<Box<dyn File>>,
1417
pub(crate) path: PathBuf,
1518
}
1619

crates/pgt_cli/src/execute/walk.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,10 @@ fn traverse_inputs(
161161

162162
struct DiagnosticsPrinter<'ctx> {
163163
_config: &'ctx ExecutionConfig,
164+
/// The maximum number of diagnostics the console thread is allowed to print
164165
max_diagnostics: u32,
165166
remaining_diagnostics: AtomicU32,
167+
/// Count of diagnostics that exceeded max_diagnostics and weren't printed
166168
not_printed_diagnostics: AtomicU32,
167169
printed_diagnostics: AtomicU32,
168170
total_skipped_suggested_fixes: AtomicU32,

crates/pgt_cli/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ impl<'app> CliSession<'app> {
8787
staged,
8888
changed,
8989
since,
90-
apply: false,
91-
apply_unsafe: false,
9290
},
9391
),
9492
PgtCommand::Clean => commands::clean::clean(self),

crates/pgt_cli/src/reporter/gitlab.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,19 @@ impl Display for GitLabDiagnostics<'_> {
139139
}
140140
}
141141

142+
/// An entry in the GitLab Code Quality report.
143+
/// See https://docs.gitlab.com/ee/ci/testing/code_quality.html#implement-a-custom-tool
142144
#[derive(Serialize)]
143145
pub struct GitLabDiagnostic<'a> {
146+
/// A description of the code quality violation.
144147
description: String,
148+
/// A unique name representing the static analysis check that emitted this issue.
145149
check_name: &'a str,
150+
/// A unique fingerprint to identify the code quality violation. For example, an MD5 hash.
146151
fingerprint: String,
152+
/// A severity string (can be info, minor, major, critical, or blocker).
147153
severity: &'a str,
154+
/// The location where the code quality violation occurred.
148155
location: Location,
149156
}
150157

0 commit comments

Comments
 (0)