-
Notifications
You must be signed in to change notification settings - Fork 446
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
Upgrade clang-format to 10.0.0, run ./tools/format.sh #544
Conversation
28732e6
to
6034164
Compare
Codecov Report
@@ Coverage Diff @@
## main #544 +/- ##
==========================================
+ Coverage 94.32% 94.33% +0.01%
==========================================
Files 197 197
Lines 8803 8801 -2
==========================================
- Hits 8303 8302 -1
+ Misses 500 499 -1
|
b22d31b
to
e553734
Compare
ci/install_format_tools.sh
Outdated
@@ -2,7 +2,8 @@ | |||
|
|||
set -e | |||
|
|||
apt install -y clang-format-8 python3-pip git curl | |||
apt-get update | |||
apt-get install -y clang-format-11 python3-pip git curl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: format.sh also needs to be modified to ensure right version is picked in case there are multiple versions installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far I was not able to find the package to install... Some help would be appreciated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which OS ? I can see multiple clang-format versions for ubuntu-latest
in default repo:
root@e4c04138cab4:/# apt-cache search clang-format
arcanist-clang-format-linter - clang-format linter for Arcanist
clang-format - Tool to format C/C++/Obj-C code
clang-format-10 - Tool to format C/C++/Obj-C code
clang-format-6.0 - Tool to format C/C++/Obj-C code
clang-format-7 - Tool to format C/C++/Obj-C code
clang-format-8 - Tool to format C/C++/Obj-C code
clang-format-9 - Tool to format C/C++/Obj-C code
clang-format-11 - Tool to format C/C++/Obj-C code
``
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See the github action failing message:
Reading state information...
E: Unable to locate package clang-format-11
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. Missed out the failure.
ubuntu-18.04
and ubuntu-20.04
virtual machines in github doesn't bring clang-format-11 :
https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md : Clang 8.0.1, 9.0.1, 10.0.0
https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu1804-README.md : Clang 6.0.0, 8.0.0, 9.0.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest we use the one available in apt-cache with highest version (clang-format-10?), as we usually need run clang-format locally so no need to complicate it with building from source or install binary package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the best long term option is to have a Docker container with all this formating/linting tools that everyone can use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See open-telemetry/build-tools#28 for the docker image and instructions to run
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please @lalitb @ThomsonTan @maxgolov review that PR :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM other than the suggested change.
e082a7d
to
1544016
Compare
One minor thing we may want to check if Visual Studio 2019 has the same formatter. Right now it does respect the |
We're good. I verified that vs2019 does have 10 as the default in the latest update. |
@maxgolov what is that? Are you not using vim? :)) |
Signed-off-by: Bogdan Drutu <[email protected]>
1544016
to
34dfd5e
Compare
Signed-off-by: Bogdan Drutu [email protected]