disrupted / blackd-client Goto Github PK
View Code? Open in Web Editor NEW⬛ Faster Python code formatting using Black
License: GNU General Public License v3.0
⬛ Faster Python code formatting using Black
License: GNU General Public License v3.0
Hi, I installed the package using mason.nvim and black, and I followed your dotfile repo to configure null-ls. But it's not working. When I try to format a Python file cat some_file.py | blackd-client
, I get an error message that says Error formatting with blackd-client: Connection refused (os error 61)
. Can you help me fix this problem?
Hi, I'm trying to install the package using cargo, but failed to build it on macOS 12.0.1 (21A559). Am I missing something here? Thanks.
$ cargo --version
cargo 1.56.0 (4ed5d137b 2021-10-04)
$ cargo install blackd-client
Updating crates.io index
Installing blackd-client v0.0.4
Compiling version_check v0.9.3
Compiling proc-macro2 v1.0.32
Compiling unicode-xid v0.2.2
Compiling syn v1.0.81
Compiling autocfg v1.0.1
Compiling memchr v2.4.1
Compiling libc v0.2.106
Compiling log v0.4.14
Compiling unicode-segmentation v1.8.0
Compiling minreq v2.4.2
Compiling cfg-if v1.0.0
Compiling hashbrown v0.11.2
Compiling unicode-width v0.1.9
Compiling strsim v0.10.0
Compiling bitflags v1.3.2
Compiling termcolor v1.1.2
Compiling lazy_static v1.4.0
Compiling custom_error v1.9.2
Compiling textwrap v0.14.2
Compiling proc-macro-error-attr v1.0.4
Compiling proc-macro-error v1.0.4
Compiling unicase v2.6.0
Compiling indexmap v1.7.0
Compiling heck v0.3.3
Compiling os_str_bytes v4.2.0
Compiling atty v0.2.14
Compiling quote v1.0.10
Compiling clap_derive v3.0.0-beta.5
Compiling clap v3.0.0-beta.5
Compiling blackd-client v0.0.4
error[E0432]: unresolved import `clap::Clap`
--> /Users/User/.asdf/installs/rust/1.56.0/registry/src/github.com-1ecc6299db9ec823/blackd-client-0.0.4/src/main.rs:1:40
|
1 | use clap::{crate_version, AppSettings, Clap};
| ^^^^ no `Clap` in the root
error: cannot determine resolution for the derive macro `Clap`
--> /Users/User/.asdf/installs/rust/1.56.0/registry/src/github.com-1ecc6299db9ec823/blackd-client-0.0.4/src/main.rs:6:10
|
6 | #[derive(Clap)]
| ^^^^
|
= note: import resolution is stuck, try simplifying macro imports
error: cannot find attribute `clap` in this scope
--> /Users/User/.asdf/installs/rust/1.56.0/registry/src/github.com-1ecc6299db9ec823/blackd-client-0.0.4/src/main.rs:7:3
|
7 | #[clap(version = crate_version!())]
| ^^^^
|
= note: `clap` is in scope, but it is a crate, not an attribute
error: cannot find attribute `clap` in this scope
--> /Users/User/.asdf/installs/rust/1.56.0/registry/src/github.com-1ecc6299db9ec823/blackd-client-0.0.4/src/main.rs:8:3
|
8 | #[clap(setting = AppSettings::ColoredHelp)]
| ^^^^
|
= note: `clap` is in scope, but it is a crate, not an attribute
error: cannot find attribute `clap` in this scope
--> /Users/User/.asdf/installs/rust/1.56.0/registry/src/github.com-1ecc6299db9ec823/blackd-client-0.0.4/src/main.rs:11:7
|
11 | #[clap(long, default_value = "http://localhost:45484")]
| ^^^^
|
= note: `clap` is in scope, but it is a crate, not an attribute
error[E0599]: no function or associated item named `parse` found for struct `Opts` in the current scope
--> /Users/User/.asdf/installs/rust/1.56.0/registry/src/github.com-1ecc6299db9ec823/blackd-client-0.0.4/src/main.rs:23:28
|
9 | struct Opts {
| ----------- function or associated item `parse` not found for this
...
23 | let opts: Opts = Opts::parse();
| ^^^^^ function or associated item not found in `Opts`
|
= help: items from traits can only be used if the trait is implemented and in scope
= note: the following trait defines an item `parse`, perhaps you need to implement it:
candidate #1: `Parser`
Some errors have detailed explanations: E0432, E0599.
For more information about an error, try `rustc --explain E0432`.
error: failed to compile `blackd-client v0.0.4`, intermediate artifacts can be found at `/var/folders/jd/0nmjhl0d5ns0qmpktsvk6nmc0000gn/T/cargo-install5Xa3aP`
Caused by:
could not compile `blackd-client` due to 6 previous errors
Hello! I am trying to use this plugin with null-ls
but whenever I run the blackd-client
command I receive an error saying:
Error formatting with blackd-client: Connection refused (os error 111)
My config is here:
local null_ls = require('null-ls')
local h = require 'null-ls.helpers'
local blackd = {
name = 'blackd',
method = null_ls.methods.FORMATTING,
filetypes = { 'python' },
generator = h.formatter_factory {
command = 'blackd-client',
to_stdin = true,
},
}
null_ls.setup {
sources = {
null_ls.builtins.formatting.deno_fmt.with {
extra_args = { '--single-quote' },
},
null_ls.builtins.formatting.clang_format.with {
extra_args = { '--style', '{IndentWidth: 4}' },
},
blackd,
},
}
NOTE: This output is when I manually call the blackd-client
command, I also tried formatting on save and this just does nothing with no error output. Thanks for your help!
The link in the neovim integration section for the null-ls setup is broken, presumably due to reorganizing your neovim config.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.