-
Notifications
You must be signed in to change notification settings - Fork 3
refactor: rename some structs and fields to follow Rust naming conventions. #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hi @yyc12345. Thanks for your PR. I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Reviewer's GuideThis PR refactors error types and related identifiers across the codebase to conform with Rust naming conventions—renaming enums, variants, and subcommand error types, and updating all affected function signatures, imports, and error mappings in one pass. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @yyc12345 - I've reviewed your changes - here's some feedback:
- There’s a typo in function names like
try_laod_tx_config_file— it should betry_load_*for consistency. - Consider giving each subcommand its own error enum name instead of reusing a generic
CmdErrorto improve clarity and avoid import ambiguity.
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
src/transifex/tx_config_file.rs
Outdated
| } | ||
|
|
||
| pub fn try_laod_tx_config_file(project_root: &PathBuf) -> Result<(PathBuf, TxConfig), TxConfigLoadError> { | ||
| pub fn try_laod_tx_config_file(project_root: &PathBuf) -> Result<(PathBuf, TxConfig), LoadTxConfigError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (typo): Typo in function name: "laod" → "load"
Rename the function to try_load_tx_config_file.
Suggested implementation:
pub fn try_load_tx_config_file(project_root: &PathBuf) -> Result<(PathBuf, TxConfig), LoadTxConfigError> {• Search for all occurrences of try_laod_tx_config_file (in tests, other modules, etc.) and rename them to try_load_tx_config_file.
|
|
||
| let mut tx_section = TransifexRcSection::default(); | ||
|
|
||
| let sections = config.sections(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
issue: No error if INI has zero sections
Since from_str returns a default struct with empty fields when sections() is empty, return an error to avoid silent misconfiguration.
…tions. - rename the error type in each subcommand module to a simple `CmdError`, as there are no naming conflicts, keeping the name simple. - rename error type and their field names to "verb + noun" style, instead of "noun + verb" format. - remove useless `Error` suffix from the members of the error type. - fix `laod` typo.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, yyc12345 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
CmdError, as there are no naming conflicts, keeping the name simple.Errorsuffix from the members of the error type.Summary by Sourcery
Refactor error types and related names across the codebase to follow Rust naming conventions by adopting concise, verb-noun style identifiers and removing redundant “Error” suffixes.
Enhancements:
CmdErrortype.