hanslub42 / rlwrap

A readline wrapper
GNU General Public License v2.0
2.53k stars 149 forks source link

Enhance Code Readability with clang-format and Refactoring #188

Open atsushifx opened 6 months ago

atsushifx commented 6 months ago

This pull request includes a series of changes made primarily through the application of clang-format to enhance code formatting and readability. It is recommended to review these changes with the -w and -b options in diff to ignore whitespace changes, providing a clearer view of the substantive modifications. The specific improvements are as follows:

  1. Application of clang-format: Utilized clang-format to standardize and clean up the codebase, aligning it with best practices for formatting and style.

  2. Removal of unnecessary blank lines: Eliminated superfluous blank lines found among some global variable declarations and function declarations, making the code more compact and easy to navigate.

  3. Breaking long comments into multiple lines: Refactored lengthy comments to span multiple lines, thereby improving the readability and maintainability of the code.

  4. Standardization of variable declaration formatting: Reorganized multi-line variable declarations to adhere to a uniform format, enhancing the visual coherence of the code.

  5. Adjustment of indentation: Fine-tuned the indentation within conditional statements and function calls to better illustrate the logical structure of the code.

  6. Code refactoring: Simplified complex conditional statements, making them more understandable and maintainable.

The primary goal of these changes is to improve the overall quality and maintainability of the code, facilitating easier understanding and modification by other developers in the future. This pull request focuses on non-functional enhancements, maintaining the existing behavior of the application while significantly improving its underlying code structure.

atsushifx commented 6 months ago

if you check diff on github, please check with w=1 option. (i.e. https://github.com/hanslub42/rlwrap/pull/188/files?w=1 ) This option ignore only change spaces.