IRNAS / irnas-zephyr-template

Template for Zephyr Projects
3 stars 1 forks source link

Pre-commit: Consider changing the formatter settings for revision.cmake file #27

Closed vid553 closed 3 weeks ago

vid553 commented 2 months ago

Context

I think that the current formatting of the revision.cmake file is not very user friendly and could be made better, to be the same as it is written by Nordic and Zephyr. Consider changing this.

Currently, the file will be formatted like this:

board_check_revision(
  FORMAT
  MAJOR.MINOR.PATCH
  VALID_REVISIONS
  1.0.0
  2.0.0
  EXACT
  DEFAULT_REVISION
  2.0.0)

It would be much more readable if it would look similar to what is written on these links:

Required steps / Implementation details

Change the formatting settings for these files.

Definition of Done

Described feature is implemented.

MarkoSagadin commented 3 weeks ago

Sadly that can not be done.

As far as I can tell, Zephyr contributors format CMake files manually, that's why the CMake files in links look like that.

Our formatter (cmake_format) just aligns the function parameters one below another (if maximum column length is reached), this is the default.

To achieve what you want, the formatter would have to know the relationships between the function parameters, to group them nicely, which it doesn't.

Please close the issue, if you are satisfied with the explanation.

vid553 commented 3 weeks ago

Closing this based on the discussion we had some time ago and your comment above. (it's a minor thing anyway)