Skip to content
This repository has been archived by the owner on Aug 12, 2023. It is now read-only.

feat: add blackd support #1606

Merged
merged 12 commits into from
Jul 4, 2023
Merged

Conversation

tiagovla
Copy link
Contributor

@tiagovla

This comment was marked as outdated.

@tiagovla

This comment was marked as outdated.

@tiagovla tiagovla marked this pull request as ready for review June 26, 2023 18:57
lua/null-ls/builtins/formatting/blackd.lua Outdated Show resolved Hide resolved
lua/null-ls/builtins/formatting/blackd.lua Outdated Show resolved Hide resolved
name = "blackd",
meta = {
url = "https://github.com/psf/black",
description = "The uncompromising Python code formatter",

Choose a reason for hiding this comment

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

Does this need to be updated? Ideally this would clarify the difference between black and blackd and also mention how to configure the source.

Also, will blackd automatically pick up config files?

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 added the meta info, not sure if the lines can be that long.

It can't pick up config files at all, the only possible configuration are the options I listed. It is quite limited.

@@ -0,0 +1,84 @@
local curl = require("plenary.curl")

Choose a reason for hiding this comment

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

Can you move this require statement into the generator callback? At the moment it's breaking the documentation autogen script, since the script doesn't have access to Plenary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

name = "blackd",
meta = {
url = "https://github.com/psf/black",
description = "blackd is a small HTTP server that exposes Black’s functionality over a simple protocol. The main benefit of using it is to avoid the cost of starting up a new Black process every time you want to blacken a file.",

Choose a reason for hiding this comment

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

Can we also mention that the only way to configure the formatter is by using the provided config options, i.e. that it won't pick up on config files at all? If you'd like to split info across lines, you can use the meta.notes key.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@jose-elias-alvarez
Copy link
Owner

Thank you!

@jose-elias-alvarez jose-elias-alvarez merged commit 740571d into jose-elias-alvarez:main Jul 4, 2023
3 checks passed
@tiagovla tiagovla deleted the blackd branch July 4, 2023 21:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants