-
Notifications
You must be signed in to change notification settings - Fork 38
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
refactor: Adding ability to convert field name from camelCase to CONSTANT_CASE if varName
is not specified for @EnvField
#42
Conversation
varName
is not specified for @EnvField
varName
is not specified for @EnvField
Hi @ryanaidilp Can you please resolve the merge conflicts with the main branch? |
Okay, resolving it now. |
Couple of observations:
import 'package:recase/recase.dart';
final String varName = 'camelCaseVariable'.constantCase; // becomes CAMEL_CASE_VARIABLE |
Thank you for your feedback! I appreciate your suggestions. Regarding your first point, I've implemented your advice and added a flag to enable and disable this feature. It's no longer the default behavior. Additionally, I've integrated the I've already pushed these changes in my recent commit. Kindly review it, and feel free to let me know if you have any more suggestions or concerns. Your input is valuable to improve the package further. |
@ryanaidilp Sorry to make you have to handle conflicts again but we just pushed some updates that have conflicts with this PR |
replace my own string helper with recase to convert string case to constant case
No worries at all! I've resolved the conflicts in my recent commits. Let me know if there's anything else needed. |
varName
is not specified for @EnvField
varName
is not specified for @EnvField
@ryanaidilp We merged #72 into origin/main earlier, so I resolved the merge conflicts for you. Check if everything is in order, please and if you're happy with it we can merge this into origin/main. 😇 |
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.
LGTM 🚀. Thanks for the update! Everything looks good to me. Please go ahead and merge it into main. Appreciate your assistance! 😇
This pull request adds a new feature to the
envied
package, allowing the conversion of field names from camelCase to CONSTANT_CASE if the@EnvField
annotation is not provided with a specificvarName
. The motivation behind this enhancement is to adhere to the Effective Dart rules of naming conventions, which specify that variables and field names should start with lowercase letters and use uppercase for the first letter of each subsequent word, such asfirstName
,secondName
, andgetAllColors
.With this new functionality, the
envied
package will automatically transform the field names into CONSTANT_CASE format when the@EnvField
annotation is not explicitly assigned avarName
. This conversion ensures compliance with the prescribed naming conventions, promoting consistency and readability in the codebase.The implementation includes logic to detect when the
@EnvField
annotation is not provided with avarName
and applies the necessary transformation to convert the field name from camelCase to CONSTANT_CASE. This feature adds flexibility and convenience to the package, enabling developers to adhere to the recommended naming conventions effortlessly.This pull request aligns with the goals of the
envied
package by promoting best practices and making it easier for users to adopt effective coding standards. It contributes to the overall quality and maintainability of projects utilizing theenvied
package.Thank you for considering this pull request. I am confident that this feature will enhance the functionality and usability of the
envied
package, benefiting developers who strive to follow the Effective Dart naming conventions.