Skip to content
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 variable names for readability #182

Merged
merged 19 commits into from
Feb 27, 2024

Conversation

wneessen
Copy link
Owner

This PR updates the whole code base with better, more readable variables names to address #179. The code in the smtp/ directory has been left untouched so that syncing with the upstream stdlib is not made more complicated than it has to be.

Closes #179.

wneessen and others added 19 commits February 24, 2024 12:43
The variable names in the code related to the I/O of the SMTP client have been clarified for improved readability and comprehension. For example, unclear variable names like `d` and `w` have been replaced with more meaningful names like `depth` and `writer`. The same naming improvements have also been applied to function parameters. This update aims to enhance code maintenance and simplify future development processes.
The commit includes changes such as renaming the variables `wbuf` to `buffer`, `cl` to `charLength` and functions `f` to `writeFunc` in msgWriter. This refactoring makes the code easier to read and understand. All the changes are aimed at enhancing code clarity without altering underlying logic or functionality.
The change updates various variable and function names in msg.go to make the code more intuitive. Updated names better capture what they represent or do, improving code readability and maintainability. This refactor does not impact functionality or logic of the code.
The change updates various variable and function names in msg.go to make the code more intuitive. Updated names better capture what they represent or do, improving code readability and maintainability. This refactor does not impact functionality or logic of the code.
…reaker.go

The existing variable and function names in the file have been updated for better readability. This change aids in code comprehension without affecting its functionality or logic. With accurately depicted names, the maintainability of the code is enhanced.
The comments within the tls.go file had multiple typographical errors which could have caused misunderstandings. These typos have been corrected to improve the clarity of the comments and maintain code understanding.
The commit introduces improved variable names in the SMTP client code that are more expressive and better describe the function they perform. This is combined with corrections to some code comments. It's aimed to increase code readability and maintainability. Updates are made across the client_119.go and client.go files to ensure consistent naming conventions.
Improved variable names in the SMTP client code to make them more expressive and descriptive. Also corrected several code comments to enhance clarity. These changes are intended to increase code readability and maintainability and have been implemented throughout the client_119.go and client.go files for consistency in naming conventions.
Variable names in reader.go have been changed to be more expressive for improved readability. 'buf' and 'off' were renamed to 'buffer' and 'offset' respectively throughout the file. The changes also include corresponding adjustments in code comments and related test cases, contributing to consistent and understandable code.
A new test function named "TestNewMsgWithNoDefaultUserAgent" has been added in `msg_test.go` file. This function is meant to test 'NewMsg' function with 'WithNoDefaultUserAgent' parameter. The addition is devised to enhance the test coverage and ensure the noDefaultUserAgent field is functioning correctly.
Updated the test "check default user agent" in `msg_test.go` to reflect dynamic versioning. The wantUserAgent field now uses fmt.Sprintf to combine the go-mail version dynamically, improving the accuracy of testing.
Updated variable names in the client_119.go file to enhance readability and clarity. This observes best practices for naming conventions in Go, producing cleaner code that's easier to maintain and troubleshoot. Changes primarily consist of replacing abbreviations with full descriptive names.
Updated variable names in the client_120.go file to enhance readability and clarity. This observes best practices for naming conventions in Go, producing cleaner code that's easier to maintain and troubleshoot. Changes primarily consist of replacing abbreviations with full descriptive names.
Updated variable names in multiple files to enhance code readability and maintainability by replacing abbreviations with full descriptive names. This ensures adherence to the best practices of naming conventions in Go.
Adjusted variable names in several functions and improved code readability. Full, descriptive names have replaced abbreviations to make the codes self-explanatory. The change is aimed at enhancing code maintenance and adhering to Go's best practices for naming conventions.
Changed variable names for more clarity in senderror.go. This change has converted abbreviated variable names into meaningful and self-explanatory variables. This effort improves code readability and maintainability following Go's best practices.
Updated variable names from abbreviations to full names for better code readability in the log and test log files. This modification provides a clearer understanding of variable roles and improves code maintainability in adherence to Go's best practices.
Changed the abbreviation 'idx' to 'i' in the 'random.go' file. This change makes the variable roles much clearer and aligns the naming with Go's best practice, enhancing readability and maintainability.
Copy link

codecov bot commented Feb 27, 2024

Codecov Report

Attention: Patch coverage is 88.54875% with 101 lines in your changes are missing coverage. Please review.

Project coverage is 81.50%. Comparing base (5c143cb) to head (514e68b).

Files Patch % Lines
msg.go 92.91% 14 Missing and 12 partials ⚠️
client_120.go 54.90% 17 Missing and 6 partials ⚠️
client.go 84.28% 8 Missing and 14 partials ⚠️
msgwriter.go 88.30% 12 Missing and 8 partials ⚠️
random.go 72.41% 5 Missing and 3 partials ⚠️
senderror.go 85.71% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #182      +/-   ##
==========================================
+ Coverage   81.31%   81.50%   +0.19%     
==========================================
  Files          24       24              
  Lines        2135     2141       +6     
==========================================
+ Hits         1736     1745       +9     
+ Misses        285      282       -3     
  Partials      114      114              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@wneessen wneessen merged commit 1c883a8 into main Feb 27, 2024
26 checks passed
@wneessen wneessen deleted the feature/179_refactor-variable-names-for-readability branch February 27, 2024 11:04
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.

Refactor variable names for readability
1 participant