Skip to content

Conversation

@ANAVHEOBA
Copy link

Remove unit value let-bindings and assert_eq comparisons in tests. Use matches! macro instead of match expression in lexer.

Remove unit value let-bindings and assert_eq comparisons in tests.
Use matches! macro instead of match expression in lexer.
Make error messages more user-friendly and actionable when version
specifications are missing components (e.g., '0.34' instead of '0.34.0').

Before: 'missing patch version: 0.34'
After: 'incomplete version: 0.34.x - versions must follow MAJOR.MINOR.PATCH format (e.g., 0.34.0)'

Also added tests for range parsing with incomplete versions to ensure
these error cases are properly covered.

Addresses issue gleam-lang#35
Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

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

Thank you, I've left some notes in line

fmt,
"incomplete version: {}.x.x - versions must follow MAJOR.MINOR.PATCH format (e.g., {}.0.0)",
major, major
)
Copy link
Member

Choose a reason for hiding this comment

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

These changes seem unrelated to clippy. Could you revert them please

config.api_base = http::Uri::try_from(server.url()).unwrap();

let result = crate::api_remove_docs_response(
crate::api_remove_docs_response(
Copy link
Member

Choose a reason for hiding this comment

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

These tests no longer ensure the return type is unit. Add an annotation or similar to put back that test functionality please.

assert!(error_msg.contains("incomplete version"));
assert!(error_msg.contains("1.x.x"));
assert!(error_msg.contains("1.0.0"));
}
Copy link
Member

Choose a reason for hiding this comment

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

These seem unrelated to clippy, please remove them

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.

3 participants