-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Labels
A-ToolsArea: Tooling and build systems, including CMakeArea: Tooling and build systems, including CMakeC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.
Description
The problem
I encountered a problem, when committing a change to the repo: my automatic cargo fmt
formatted an unrelated line in the file:
Diff in /lagann/Development/qmetaobject-rs/qmetaobject/src/qtdeclarative.rs at line 506:
///
/// [qt]: https://doc.qt.io/qt-5/qqmlengine.html#qmlRegisterModule
#[cfg(qt_5_9)]
-pub fn qml_register_module(
- uri: &CStr,
- version_major: u32,
- version_minor: u32,
-) {
+pub fn qml_register_module(uri: &CStr, version_major: u32, version_minor: u32) {
let uri_ptr = uri.as_ptr();
cpp!(unsafe [
To commit my changes, I had to exclude the diff above from the git, which is inconvenient.
Apparently, this was left, because there wasn't an automatic check in the CI, when the PR was merged.
Possible solution
- There should be an automatic check in the CI to prevent merging the PR with incorrect code formatting.
- To simplify the life of the developers, there should be a pre-commit hook, that formats the code automatically before committing.
Metadata
Metadata
Assignees
Labels
A-ToolsArea: Tooling and build systems, including CMakeArea: Tooling and build systems, including CMakeC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.