Skip to content

Pre-commit config - Ruff, cmake & clang formaters#4

Merged
macmacal merged 6 commits intohumble-develfrom
feature/cpp_pre-commit
Feb 12, 2025
Merged

Pre-commit config - Ruff, cmake & clang formaters#4
macmacal merged 6 commits intohumble-develfrom
feature/cpp_pre-commit

Conversation

@macmacal
Copy link
Contributor

@macmacal macmacal commented Feb 10, 2025

Description

Inspired by pre-config config proposed in machines-in-motion/mim_solvers/pull/45 , this PR introduces such convenience to this repository: C++, Python and CMakeLists formatters.

Warning

It also adds the -Werror flag to the compiler. (But resulted in issue #5)

Motivation and context

  • The lack of auto-formatters for C++ and CMakeLists.

How has this been tested?

  • Manually by running pre-commit run --all-files -v

Checklist

  • All TODOs in the code have been resolved or linked to a proper issue.
  • Code has been (auto)formatted.
  • Documentation (e.g., README, CHANGELOG, Wiki) has been updated.
  • All automated checks have passed.

Clickup task: 8697wj13v

@macmacal macmacal added the enhancement New feature or request label Feb 10, 2025
Copy link
Contributor

@slimasziom slimasziom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we stay with screaming case or stick to google style (constants)? Any other customizations?

@macmacal
Copy link
Contributor Author

Do we stay with screaming case or stick to google style (constants)? Any other customizations?

Let's stick with the SCREAMING_CASE. The other changes are now defined in the .clang-format file.

Copy link
Contributor

@slimasziom slimasziom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

Copy link
Contributor

@sivral sivral left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@macmacal
Copy link
Contributor Author

macmacal commented Feb 12, 2025

The -Werror flag already showed problem with the example test code (point 6).
An issue is created for that #5 . For now, the -Werror flag is disabled.

@macmacal macmacal merged commit 8733050 into humble-devel Feb 12, 2025
1 check passed
@macmacal macmacal deleted the feature/cpp_pre-commit branch February 12, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants