Skip to content

Conversation

@theCapypara
Copy link
Contributor

I hope the README.md I added is OK, it's a bit of an unfortunate situation but it wasn't too bad to get it working.

Closes #716

@@ -0,0 +1,20 @@
#!/usr/bin/env bash
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is for local execution. See package.json.

gi.require_version("Adw", "1")
from gi.repository import Gtk, Adw
import workbench

Copy link
Contributor Author

@theCapypara theCapypara Oct 29, 2023

Choose a reason for hiding this comment

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

This is the pre-commit hook doing its magic :)

Copy link
Contributor

@sonnyp sonnyp left a comment

Choose a reason for hiding this comment

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

One more thing I forgot, could you add a check to make lint (Makefile) that errors if the code isn't formatted ?

This runs as part of github workflow

of black and their dependencies and add them to the JSON as well. Brute-forcing the build to obtain missing packages
may help as does referencing old commits of the file. You can also use the generator command to generate dependencies
for them and then merge it into the file by hand, but note that you will also need to manually collect their build
dependencies too.
Copy link
Contributor

Choose a reason for hiding this comment

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

excellent doc 👌

thank you

fi
fi

exec black "$@"
Copy link
Contributor

@sonnyp sonnyp Oct 29, 2023

Choose a reason for hiding this comment

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

Ideally we would use Flatpak

Could black be part of a Python sdk at some point?

An other option is to build the Workbench Flatpak once before running the pre-commits
And using the tooling from within the Workbench runtime

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Would probably be useful to have in the SDK. I feel like pre-building the Workbench Flatpak is a bit convoluted and error prone.

@sonnyp
Copy link
Contributor

sonnyp commented Oct 29, 2023

Nevermind - it's already there :)

Copy link
Contributor

@sonnyp sonnyp left a comment

Choose a reason for hiding this comment

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

Great work!

@sonnyp sonnyp changed the title ci: Run black to format Python code Implement Python formatting with black Oct 29, 2023
@sonnyp sonnyp merged commit 72685e3 into main Oct 29, 2023
@sonnyp sonnyp deleted the capypara/python-format branch October 29, 2023 17:42
gregorni pushed a commit that referenced this pull request Oct 29, 2023
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Python code formatting

3 participants