Skip to content

[FEAT] style warnings#354

Merged
akhilles merged 8 commits intomainfrom
feat/style-warnings
Dec 16, 2025
Merged

[FEAT] style warnings#354
akhilles merged 8 commits intomainfrom
feat/style-warnings

Conversation

@hexdae
Copy link
Contributor

@hexdae hexdae commented Dec 15, 2025

Description

Add code style advice diagnostics and promote them to warnings in the LSP to enforce a more cohesive coding standard for the models

Copy link
Contributor

@akhilles akhilles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest using https://docs.rs/heck. it has ToSnekCase, ToShoutySnekCase. We already depend on this crate.

}

/// Convert a name to UPPERCASE convention.
pub fn to_uppercase(name: &str) -> String {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure this is needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we might want to inject things like promoting ~ to N in the future, so I would rather have this here to do that in our naming conventions

/// - Cannot end with an underscore
///
/// Examples: `enable_debug`, `num_channels`, `output_voltage`
pub fn is_snake_case(name: &str) -> bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, simpler to just run to_snake_case and check for equivalence. This way you don't have to keep the two consistent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

}

/// Convert a name to snake_case convention.
pub fn to_snake_case(name: &str) -> String {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@akhilles akhilles merged commit 17b71ad into main Dec 16, 2025
7 checks passed
@akhilles akhilles deleted the feat/style-warnings branch December 16, 2025 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants