Skip to content

Commit d3f0a21

Browse files
psteinroeclaude
andcommitted
fix: update imports and resolve clippy warnings
- Fix unresolved import from analyser to linter in workspace tests - Remove empty line after outer attribute in diagnostics - Apply clippy suggestions for cleaner code 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0e32289 commit d3f0a21

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

crates/pgls_diagnostics/src/serde.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ impl From<super::Location<'_>> for Location {
164164
#[serde(rename_all = "camelCase")]
165165
#[cfg_attr(feature = "schema", derive(schemars::JsonSchema))]
166166
#[cfg_attr(test, derive(Eq, PartialEq))]
167-
168167
struct Advices {
169168
advices: Vec<Advice>,
170169
}

crates/pgls_workspace/src/workspace/server/analyser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ impl RegistryVisitor for LintVisitor<'_, '_> {
141141
#[cfg(test)]
142142
mod tests {
143143
use pgls_analyse::RuleFilter;
144-
use pgls_configuration::{RuleConfiguration, Rules, analyser::Safety};
144+
use pgls_configuration::{RuleConfiguration, Rules, linter::Safety};
145145

146146
use crate::{
147147
settings::{LinterSettings, Settings},

xtask/codegen/src/generate_configuration.rs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ use proc_macro2::{Ident, Literal, Span, TokenStream};
66
use pulldown_cmark::{Event, Parser, Tag, TagEnd};
77
use quote::quote;
88
use std::collections::BTreeMap;
9-
use std::path::PathBuf;
109
use xtask::*;
1110

1211
/// Configuration for a tool that produces rules
@@ -26,11 +25,13 @@ impl ToolConfig {
2625
}
2726

2827
/// Derived: Crate name that contains the rules
28+
#[allow(dead_code)]
2929
fn crate_name(&self) -> String {
3030
format!("pgls_{}", self.name)
3131
}
3232

3333
/// Derived: The main struct name (Rules, Actions, or Transformations)
34+
#[allow(dead_code)]
3435
fn struct_name(&self) -> &str {
3536
match self.category {
3637
RuleCategory::Lint => "Rules",
@@ -230,7 +231,7 @@ fn generate_lint_mod_file(tool: &ToolConfig) -> String {
230231

231232
/// Generate the rules.rs file for a Lint tool
232233
fn generate_lint_rules_file(
233-
tool: &ToolConfig,
234+
_tool: &ToolConfig,
234235
groups: BTreeMap<&'static str, BTreeMap<&'static str, RuleMetadata>>,
235236
) -> Result<String> {
236237
let mut struct_groups = Vec::with_capacity(groups.len());
@@ -448,7 +449,7 @@ fn generate_lint_rules_file(
448449
}
449450
};
450451

451-
Ok(xtask::reformat(rules_struct_content.to_string())?)
452+
xtask::reformat(rules_struct_content.to_string())
452453
}
453454

454455
/// Generate a group struct for lint rules
@@ -664,13 +665,13 @@ fn extract_summary_from_docs(docs: &str) -> String {
664665
}
665666
Event::Start(tag) => match tag {
666667
Tag::Strong | Tag::Paragraph => continue,
667-
_ => panic!("Unimplemented tag {:?}", tag),
668+
_ => panic!("Unimplemented tag {tag:?}"),
668669
},
669670
Event::End(tag) => match tag {
670671
TagEnd::Strong | TagEnd::Paragraph => continue,
671-
_ => panic!("Unimplemented tag {:?}", tag),
672+
_ => panic!("Unimplemented tag {tag:?}"),
672673
},
673-
_ => panic!("Unimplemented event {:?}", event),
674+
_ => panic!("Unimplemented event {event:?}"),
674675
}
675676
}
676677

@@ -756,7 +757,7 @@ fn generate_action_mod_file(tool: &ToolConfig) -> String {
756757

757758
/// Generate the actions.rs file for an Action tool
758759
fn generate_action_actions_file(
759-
tool: &ToolConfig,
760+
_tool: &ToolConfig,
760761
groups: BTreeMap<&'static str, BTreeMap<&'static str, RuleMetadata>>,
761762
) -> Result<String> {
762763
let mut struct_groups = Vec::with_capacity(groups.len());
@@ -905,7 +906,7 @@ fn generate_action_actions_file(
905906
}
906907
};
907908

908-
Ok(xtask::reformat(actions_struct_content.to_string())?)
909+
xtask::reformat(actions_struct_content.to_string())
909910
}
910911

911912
/// Generate a group struct for action rules

0 commit comments

Comments
 (0)