Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] utils/grass_clang_format.sh fails to detect version #3183

Closed
marisn opened this issue Sep 23, 2023 · 1 comment · Fixed by #3186
Closed

[Bug] utils/grass_clang_format.sh fails to detect version #3183

marisn opened this issue Sep 23, 2023 · 1 comment · Fixed by #3186
Assignees
Labels
bug Something isn't working
Milestone

Comments

@marisn
Copy link
Contributor

marisn commented Sep 23, 2023

On Debian version number is the fourth item:
clang-format --version Debian clang-format version 16.0.6 (15)
But the script expects it to be the third item:
clang_version=$(echo "${clang_version_full}" | cut -f3 -d" " | cut -f1 -d".")
https://github.com/OSGeo/grass/blob/main/utils/grass_clang_format.sh#L56

The version check should be rewritten to deal with customized version strings.

@marisn marisn added the bug Something isn't working label Sep 23, 2023
@nilason nilason self-assigned this Sep 23, 2023
@nilason
Copy link
Contributor

nilason commented Sep 23, 2023

Could you please test:

clang-format --version | sed -En 's/.*version ([0-9]+)\.[0-9]+\.[0-9]+.*/\1/p'

It should print the major version.

nilason added a commit to nilason/grass that referenced this issue Sep 24, 2023
- Adopt to the fact the result of `clang-format --version` may look slightly different
  on various platforms.
- Make sure 'clang-format' version 15 is used (v 16+ results in unwanted changes)

Closes OSGeo#3183
nilason added a commit that referenced this issue Oct 4, 2023
- Adopt to the fact the result of `clang-format --version` may look slightly different
  on various platforms.
- Make sure 'clang-format' version 15 is used (v 16+ results in unwanted changes)

Closes #3183
@neteler neteler added this to the 8.4.0 milestone Oct 5, 2023
landam pushed a commit to landam/grass that referenced this issue Oct 25, 2023
- Adopt to the fact the result of `clang-format --version` may look slightly different
  on various platforms.
- Make sure 'clang-format' version 15 is used (v 16+ results in unwanted changes)

Closes OSGeo#3183
neteler pushed a commit to nilason/grass that referenced this issue Nov 7, 2023
- Adopt to the fact the result of `clang-format --version` may look slightly different
  on various platforms.
- Make sure 'clang-format' version 15 is used (v 16+ results in unwanted changes)

Closes OSGeo#3183
HuidaeCho pushed a commit to HuidaeCho/grass that referenced this issue Jan 9, 2024
- Adopt to the fact the result of `clang-format --version` may look slightly different
  on various platforms.
- Make sure 'clang-format' version 15 is used (v 16+ results in unwanted changes)

Closes OSGeo#3183
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants