Skip to content

Allow excluding prefixes for objects #1064

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Cryoris
Copy link

@Cryoris Cryoris commented Apr 4, 2025

Summary

I went ahead and opened a proposal to fix #1061. This would add a new config called prefix_excludes, which allows to exclude objects from being prefixed, if a prefix is enabled. If this solution is not what you'd expect I'd be happy to discuss!

Details

Usage would for example look like

[export]
prefix = "MyPrefix_"
prefix_excludes = ["NoPrefixForMe", "NoneForMe"]

This is something that would be greatly appreciated for the C API we're building in Qiskit, where cbindgen has proven to be very useful so far 🙂

I have no experience in committing to cbindgen, I've added a test which produces the output I'm expecting, and I'm happy to add more things that are required for a PR.

Cryoris added 3 commits April 4, 2025 17:20
If a prefix is set, allow to not prefix specified objects. This is important e.g. when using 3rd Party objects in a Rust projects, that should not be renamed.
@Cryoris Cryoris mentioned this pull request May 22, 2025
3 tasks
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

Successfully merging this pull request may close these issues.

Skip export prefix on certain objects
1 participant