4. Development Guidelines¶
4.1. Code Style¶
The project follows these coding conventions:
Indentation: 4 spaces (no tabs)
Line length: Maximum 100 characters
Formatting: Enforced by
.clang-formatconfiguration (LLVM-based)Comments: Use Doxygen-style documentation comments
Naming: - Classes: CamelCase (e.g.,
CodeEditor,ChartWindow) - Qt overrides: camelCase (e.g.,setFont,eventFilter) - Custom methods/slots: snake_case (e.g.,stop_run,save_as) - Members: snake_case (e.g.,reformat_on_return)
4.2. Documentation¶
Added functionality should be documented both in the User’s Guide and
the Programmer’s Guide section of the documentation. The documentation
should have suitable .. index:: directives to populate the index
with suitable keywords. The documentation is written in
reStructuredText
and imports documentation of the source code from Doxygen using the Breathe Sphinx plugin. The documentation should translate cleanly to
HTML and PDF using the html or pdf
build targets. Additionally the build targets spelling and
linkcheck are available to run a spell checker on the documentation
and validate external links.
All public classes and functions should have Doxygen documentation as demonstrated below:
/**
* @brief Brief description
*
* Detailed description if needed
*
* @param param1 Description of parameter
* @return Description of return value
*/
int myFunction(int param1);
4.3. Building¶
See Installation for detailed build instructions. For development:
# Debug build with Qt6
cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug \\
-DLAMMPS_GUI_USE_PLUGIN=yes -DBUILD_DOC=no
cmake --build build --parallel 2
4.4. Contributing¶
To contribute to LAMMPS-GUI:
Fork the repository on GitHub
Create a feature branch
Make your changes with proper documentation
Ensure code compiles with both Qt5 and Qt6 (if possible)
Test your changes thoroughly
Submit a pull request
All contributions must:
Follow the existing code style
Include Doxygen documentation for new public APIs
Not break existing functionality
Have GPG-signed commits