Skip to content

Commit 52cd5e5

Browse files
committed
cargo-rail: cleaning scattered 'TODOs'
1 parent 63b2a02 commit 52cd5e5

File tree

2 files changed

+3
-42
lines changed

2 files changed

+3
-42
lines changed

src/core/sync.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -877,18 +877,6 @@ impl SyncEngine {
877877
Ok((conflicts, changed_files))
878878
}
879879

880-
/// Legacy method - kept for compatibility but now uses resolve_conflicts_for_commit
881-
/// TODO: Remove in favor of resolve_conflicts_for_commit once all call sites updated
882-
#[allow(dead_code)]
883-
fn check_for_conflicts(
884-
&self,
885-
remote_commit: &crate::core::vcs::CommitInfo,
886-
remote_git: &SystemGit,
887-
) -> RailResult<bool> {
888-
let (conflicts, _) = self.resolve_conflicts_for_commit(remote_commit, remote_git)?;
889-
Ok(!conflicts.is_empty())
890-
}
891-
892880
fn check_mono_has_changes(&self) -> RailResult<bool> {
893881
let last_synced = self.find_last_synced_mono_commit()?;
894882
let crate_path = &self.config.crate_paths[0];

src/quality/changelog.rs

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ use std::fmt;
1111
/// Format: `<type>(<scope>): <description>`
1212
///
1313
/// Example: `feat(auth): add OAuth2 support`
14-
// TODO(quality): Used by ChangelogGenerator, wire into release apply command
15-
#[allow(dead_code)]
1614
#[derive(Debug, Clone, PartialEq, Eq)]
1715
pub struct ConventionalCommit {
1816
/// Commit type (feat, fix, chore, docs, etc.)
@@ -30,8 +28,6 @@ pub struct ConventionalCommit {
3028
}
3129

3230
/// Conventional commit types
33-
// TODO(quality): Used by ConventionalCommit, wire into release apply command
34-
#[allow(dead_code)]
3531
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
3632
pub enum CommitType {
3733
/// New feature
@@ -62,8 +58,6 @@ pub enum CommitType {
6258

6359
impl CommitType {
6460
/// Parse commit type from string
65-
// TODO(quality): Used by ConventionalCommit parser
66-
#[allow(dead_code)]
6761
#[track_caller]
6862
pub fn from_str(s: &str) -> Self {
6963
match s.to_lowercase().as_str() {
@@ -83,15 +77,12 @@ impl CommitType {
8377
}
8478

8579
/// Check if this commit type triggers a version bump
86-
// TODO(quality): Used by ChangelogGenerator for filtering
87-
#[allow(dead_code)]
80+
#[allow(dead_code)] // Used by has_user_facing_changes() and in tests
8881
pub fn is_user_facing(&self) -> bool {
8982
matches!(self, Self::Feat | Self::Fix | Self::Perf)
9083
}
9184

9285
/// Get the display name for this commit type
93-
// TODO(quality): Used by ChangelogGenerator for section headers
94-
#[allow(dead_code)]
9586
pub fn display_name(&self) -> &'static str {
9687
match self {
9788
Self::Feat => "Features",
@@ -117,19 +108,16 @@ impl fmt::Display for CommitType {
117108
}
118109

119110
/// Changelog output format
120-
// TODO(quality): Wire into release apply command
121-
#[allow(dead_code)]
122111
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
123112
pub enum ChangelogFormat {
124113
/// Markdown format (default)
125114
Markdown,
126115
/// JSON format for programmatic use
116+
#[allow(dead_code)] // Used by render() and in tests
127117
Json,
128118
}
129119

130120
/// Generated changelog
131-
// TODO(quality): Wire into release apply command
132-
#[allow(dead_code)]
133121
#[derive(Debug, Clone)]
134122
pub struct Changelog {
135123
/// Version for this changelog
@@ -144,8 +132,6 @@ pub struct Changelog {
144132

145133
impl Changelog {
146134
/// Create a new changelog
147-
// TODO(quality): Called by ChangelogGenerator
148-
#[allow(dead_code)]
149135
pub fn new(version: String, date: String) -> Self {
150136
Self {
151137
version,
@@ -156,23 +142,18 @@ impl Changelog {
156142
}
157143

158144
/// Add a commit to the changelog
159-
// TODO(quality): Called by ChangelogGenerator
160-
#[allow(dead_code)]
161145
pub fn add_commit(&mut self, commit: ConventionalCommit, sha: String) {
162146
self.all_commit_shas.push(sha);
163147
self.commits_by_type.entry(commit.commit_type).or_default().push(commit);
164148
}
165149

166150
/// Check if there are any user-facing changes
167-
// TODO(quality): Used in release apply to determine if changelog should be generated
168-
#[allow(dead_code)]
151+
#[allow(dead_code)] // Public API for future use, tested in test_changelog_has_user_facing_changes
169152
pub fn has_user_facing_changes(&self) -> bool {
170153
self.commits_by_type.keys().any(|t| t.is_user_facing())
171154
}
172155

173156
/// Render as markdown
174-
// TODO(quality): Used by release apply to write CHANGELOG.md
175-
#[allow(dead_code)]
176157
pub fn to_markdown(&self) -> String {
177158
let mut output = String::new();
178159

@@ -232,8 +213,6 @@ impl Changelog {
232213
}
233214

234215
/// Render as JSON
235-
// TODO(quality): Used by release apply with --json flag
236-
#[allow(dead_code)]
237216
pub fn to_json(&self) -> Result<String, serde_json::Error> {
238217
use serde::{Serialize, Serializer};
239218

@@ -296,8 +275,6 @@ impl Changelog {
296275
}
297276

298277
/// Render in the specified format
299-
// TODO(quality): Main entry point for release apply
300-
#[allow(dead_code)]
301278
pub fn render(&self, format: ChangelogFormat) -> Result<String, String> {
302279
match format {
303280
ChangelogFormat::Markdown => Ok(self.to_markdown()),
@@ -308,8 +285,6 @@ impl Changelog {
308285

309286
impl ConventionalCommit {
310287
/// Check if this commit is a breaking change
311-
// TODO(quality): Used by ChangelogGenerator for version bump detection
312-
#[allow(dead_code)]
313288
pub fn is_breaking(&self) -> bool {
314289
self.breaking_change.is_some()
315290
}
@@ -318,8 +293,6 @@ impl ConventionalCommit {
318293
///
319294
/// Returns None if the message doesn't follow conventional commit format.
320295
/// This is intentional - not all commits need to be conventional.
321-
// TODO(quality): Wire into release apply command for changelog generation
322-
#[allow(dead_code)]
323296
#[track_caller]
324297
pub fn parse(message: &str) -> Option<Self> {
325298
use winnow::ascii::{alphanumeric1, space0};

0 commit comments

Comments
 (0)