Palm1r / QodeAssist

QodeAssist is an AI-powered coding assistant plugin for Qt Creator
GNU General Public License v3.0
52 stars 3 forks source link

Code formatting in the QodeAssist codebase #31

Open SidneyCogdill opened 6 days ago

SidneyCogdill commented 6 days ago

Qt Creator comes with multiple code formatting tool integrations bundled, including clang-format for C/C++, qmlformat for QML, cmake-format for CMake files.

If I leave the "auto formatting on save" options enabled while editing QodeAssist sources, then the formatting tools will kick in and re-edit the whole file, the diff on the submitted patches will be full of re-formatting noises instead of highlighting the relevant changes.

Therefore it would be helpful if the codebase decides to explicitly opt into code formatting tools and provide a customized .qmlformat.ini and .clang-format in the project directory, so that the automatic formatting tools can respect the project's code formatting style.

Note that for cmake-format it doesn't seem to have the concept of a project-scope configuration file and have to manually pass the config file path as the command line option.

Palm1r commented 6 days ago

Thank you for good idea, I agree, will add soon