Repository navigation
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 @EnvFieldvarName 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 @EnvFieldvarName 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. 😇 |
This pull request adds a new feature to the
enviedpackage, allowing the conversion of field names from camelCase to CONSTANT_CASE if the@EnvFieldannotation 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
enviedpackage will automatically transform the field names into CONSTANT_CASE format when the@EnvFieldannotation 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
@EnvFieldannotation is not provided with avarNameand 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
enviedpackage 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 theenviedpackage.Thank you for considering this pull request. I am confident that this feature will enhance the functionality and usability of the
enviedpackage, benefiting developers who strive to follow the Effective Dart naming conventions.