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

Inconsistent parameter declaration name #167

Open
marcelhuberfoo opened this issue Dec 18, 2024 · 1 comment
Open

Inconsistent parameter declaration name #167

marcelhuberfoo opened this issue Dec 18, 2024 · 1 comment

Comments

@marcelhuberfoo
Copy link

Unfortunately, the JNIGenerator is not using the same parameter names in the generated files as for example the ObjCppGenerator does.
This leads to issues reported by clang-tidy when having the readability-inconsistent-declaration-parameter-name check active.
The issue is in the following line generating the prototype, where the " " should have been " c_":

cppMarshal.fqParamType(p.ty) + " " + idCpp.local(p.ident)

like for the body writer here:
cppMarshal.fqParamType(p.ty) + " c_" + idCpp.local(p.ident)

You can use this search to compare the different generator implementations: https://github.com/search?q=repo%3Across-language-cpp%2Fdjinni-generator%20idCpp.local&type=code

I will potentially put up a PR to propose the fix.

@a4z
Copy link
Contributor

a4z commented Dec 18, 2024

Thank you for pointing out this behavior!
I agree that the generated code should work with the tools' default settings.

As far as I can see, this has nothing to do with naming conventions from the used target language, but please cross-check me on that point.

For the PR, please make the tests passing, the existing guide should still work
https://djinni.xlcpp.dev/djinni-generator/developer-guide/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants