typemytype / drawbot

http://www.drawbot.com
Other
393 stars 61 forks source link

Black settings #550

Closed roberto-arista closed 5 months ago

roberto-arista commented 7 months ago

Hey! I see black listed in the dependencies, but I cannot find the settings in the repo. Are you using it to format the code? I'd like to adhere to the repository customs : )

justvanrossum commented 7 months ago

Black is a dependency for the "Format Code" menu under "Python". Unfortunately, the code base itself doesn't use it...

roberto-arista commented 7 months ago

Is there any interest in settings it up?

justvanrossum commented 7 months ago

It will be a huge commit. I’d be in favor but only if @typemytype is comfortable with it, too.

If there are any unmerged prs they should be merged first.

Are you suggesting to set up pre-commit?

typemytype commented 7 months ago

the app requirements and package requirements could be separated.

black is only used inside the app.

add an app-requirements.txt and install them here https://github.com/typemytype/drawbot/blob/master/.github/workflows/build.yml#L51

app requirements could be: (out of my head...)

black
corefoundationasyncio
py2app
pygments
pip
justvanrossum commented 7 months ago

Maybe take the opportunity to rename the req files with "requirements" at the front, so they naturally group together:

?

roberto-arista commented 7 months ago

Are you suggesting to set up pre-commit?

I generally store the black settings in a pyproject.toml file. If there's interest, we could write them somewhere that could be picked up by different code editors...

typemytype commented 7 months ago

agree with the renaming of the requirements files

black is used here https://github.com/typemytype/drawbot/blob/dcd2eb4840be30f3f26cf54eead797fc5fde886a/drawBot/ui/drawBotController.py#L171-L178 to format the code inside the code editor, I guess no need for other settings, its not applied on the source code itself, but the code inside the codeeditor inside drawBot

typemytype commented 7 months ago
justvanrossum commented 5 months ago

Summarizing:

Conclusion:

The question remains: