8000 Replace derive macros with attribute macros, reducing boilerplate by Noxmore · Pull Request #107 · Noxmore/bevy_trenchbroom · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Replace derive macros with attribute macros, reducing boilerplate #107

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

Merged
merged 4 commits into from
Jul 8, 2025

Conversation

Noxmore
Copy link
Owner
@Noxmore Noxmore commented May 18, 2025

Closes #92
Closes #47

Implements a new macro API as described in #92.

@Noxmore
Copy link
Owner Author
Noxmore commented May 18, 2025

One annoying thing i just realized: cargo fmt converts

#[solid_class(
    base(BspSolidEntity)
)]

into

#[solid_class(base(BspSolidEntity))]

I suppose it's somewhat minor, but still hurts readability in my opinion. I really hope there's some way to turn that off, though I very much doubt we can turn it off for QuakeClass attributes specifically.

@Noxmore
Copy link
Owner Author
Noxmore commented May 18, 2025

Another issue: I don't think #[cfg_attr(...)] will work with sub-attributes. When we use that, we'll need to entirely duplicate the attribute.

@Noxmore
Copy link
Owner Author
Noxmore commented Jul 8, 2025

Been a while, let's merge this thing!
My mind has changed on the formatting thing, I really don't care now. I can be quite stubborn sometimes.
As for the #[cfg_attr(...)] thing, I'm looking at the builtin-classes branch, and I don't see or can think of anything obviously causing exponentially.
I really want this in, I think I'll merge it now and just hope for the best!

8000

@Noxmore Noxmore merged commit fc4cdf2 into main Jul 8, 2025
5 checks passed
@Noxmore Noxmore deleted the new-class-macro branch July 8, 2025 03:02
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.

Boilerplate removal for QuakeClass New class attribute API
1 participant
0