Added the clang-format formatter for generated C++ files [CTT-713]#558
Added the clang-format formatter for generated C++ files [CTT-713]#558ihsandemir wants to merge 2 commits into
clang-format formatter for generated C++ files [CTT-713]#558Conversation
Also, fixed a duplication in type mapping for type `Version`.
|
The job Click to expand the log fileTraceback (most recent call last): |
JackPGreen
left a comment
There was a problem hiding this comment.
I didn't realise you were working on this - I was working on the same problem in https://github.com/JackPGreen/hazelcast-client-protocol/tree/format-cpp-with-clang-format. Yours works just as well though.
There was a problem hiding this comment.
An alternative to duplicating the file is passing root_dir into generate_codecs and then using just referencing it (e.g. os.path.join(root_dir, ".clang-format")
|
verify |
|
verify |
|
@ihsandemir I suspect the Python runner is too old. |
I think we should also switch to github actions rather than jenkins. Well I just saw your PR. |
clang-format formatter for generated C++ filesclang-format formatter for generated C++ files [CTT-713]
|
I think adding |
|
Note that we use a similar tool for Python called |
#558 failed the PR builder because it runs on Jenkins, inside a custom Python-3.7 Docker image. [Python 3.7 has been end-of-life for 2 years](https://devguide.python.org/versions/), and is too old to support the proposed changes. We _could_ upgrade to a [newer Docker image](https://hub.docker.com/r/hazelcast/jenkins-python-client-3.9) (or even [make a new one](https://github.com/hazelcast/DevOps/tree/master/dockerfiles/clients/python)), but _I think_ it would be easier to migrate to GitHub Actions instead - the runner _already includes_ a recent Python installation. Changes: - create new GitHub action - dynamically determine languages to execute/test - previously markdown was missed Post-merge actions: - [ ] disable [Jenkins job](https://jenkins.hazelcast.com/job/Client-Protocol-pr-builder/)
We have it in the cpp repo as well. |
we can integrate it into generator in a similar way. |
Why is that necessary? The code is already formatted in the client repos. |
What do you mean? The original issue was that the
Maybe an alternative is to:
|
The generated files are not committed to "this" repo, so it's not very useful to format them.
Yes, that's the approach we have for the Python Client. |
This isn't possible - the formatting is adjusted based on the line length - e.g. a long method name (the method name being dynamic based on the service) may have it's parameters wrapped, a short one may not. |
|
Closing this PR since it was rejected by @yuce . Carried the small fix for duplicate type mapping to another PR. |
hazelcast#558 failed the PR builder because it runs on Jenkins, inside a custom Python-3.7 Docker image. [Python 3.7 has been end-of-life for 2 years](https://devguide.python.org/versions/), and is too old to support the proposed changes. We _could_ upgrade to a [newer Docker image](https://hub.docker.com/r/hazelcast/jenkins-python-client-3.9) (or even [make a new one](https://github.com/hazelcast/DevOps/tree/master/dockerfiles/clients/python)), but _I think_ it would be easier to migrate to GitHub Actions instead - the runner _already includes_ a recent Python installation. Changes: - create new GitHub action - dynamically determine languages to execute/test - previously markdown was missed Post-merge actions: - [ ] disable [Jenkins job](https://jenkins.hazelcast.com/job/Client-Protocol-pr-builder/)
Added the
clang-formatformatter for generated C++ files.Also, fixed a duplication in type mapping for type
Version.Copied the file
.clang-formatfrom cpp client repo.