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

Add Blueprint formatter support #583

Merged
merged 15 commits into from
Nov 4, 2023
Merged

Add Blueprint formatter support #583

merged 15 commits into from
Nov 4, 2023

Conversation

sonnyp
Copy link
Contributor

@sonnyp sonnyp commented Sep 9, 2023

@gregorni is working on a Blueprint formatter 🚀

https://gitlab.gnome.org/jwestman/blueprint-compiler/-/merge_requests/124

Test with

using Gtk 4.0;

Box subtitle {
  orientation: vertical;
  halign: center;
  margin-bottom: 30;
  Label {
    justify: center;
    cool: "lol";
  }
}

CI / pre-commit hook isn't included yet - see the comment in Makefile

@sonnyp sonnyp marked this pull request as draft September 9, 2023 14:17
Comment on lines -15 to +17
popover: EmojiChooser emoji_chooser {};

styles ["pill", "emoji"]
popover: EmojiChooser emoji_chooser {
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gregorni I wonder if the formatter shouldn't close empty objects inline

popover: EmojiChooser emoji_chooser {}

wdyt?

Comment on lines -19 to +20
primary: true; // May not work in Previewer
primary: true;
// May not work in Previewer
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gregorni do you think it's feasable to preserve inline comments?

Makefile Outdated
# gettext
find po/ -type f -name "*po" -print0 | xargs -0 -n1 msgfmt -o /dev/null --check
# Flatpak manifests
flatpak run --user --command=flatpak-builder-lint org.flatpak.Builder manifest --exceptions build-aux/re.sonny.Workbench.json
flatpak run --user --command=flatpak-builder-lint org.flatpak.Builder manifest --exceptions build-aux/re.sonny.Workbench.Devel.json
# Blueprint
# find src -type f -name "*blp" -print0 | xargs -0 blueprint-compiler format
find src -type f -name "*blp" -print0 | xargs -0 flatpak run --command=/app/bin/blueprint-compiler --filesystem=host:rw re.sonny.Workbench.Devel//master format
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've asked James if we could pip-ify Blueprint compiler

package.json Outdated
"*.rs": "flatpak run --user --command=/usr/lib/sdk/rust-stable/bin/rustfmt --filesystem=host org.gnome.Sdk//45 --edition 2021"
"*.py": "./build-aux/black.sh",
"*.rs": "flatpak run --user --command=/usr/lib/sdk/rust-stable/bin/rustfmt --filesystem=host org.gnome.Sdk//45 --edition 2021",
"*.blp": "flatpak run --command=/app/bin/blueprint-compiler --filesystem=host:rw re.sonny.Workbench.Devel//master format --fix"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@sonnyp sonnyp marked this pull request as ready for review November 4, 2023 12:07
@sonnyp sonnyp merged commit 3661d7b into main Nov 4, 2023
1 check passed
@sonnyp sonnyp deleted the blueprint-formatter branch November 4, 2023 12:09
lw64 pushed a commit that referenced this pull request Dec 18, 2023
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.

1 participant