Git Product home page Git Product logo

cbfmt's Introduction

cbfmt's People

Contributors

lukas-reineke avatar williamboman avatar zegervdv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

cbfmt's Issues

c/cpp support

uncrustify is a formatter for c/cpp write by rust

.cbfmt.toml

[languages]
rust = ["rustfmt"]
c= ["uncrustify -q -l C --no-backup"]

md.md

# Test
```c
int main () { int = 2; int b = 3; }
```

TRY

❯ cbfmt md.md
[Fail]: md.md

[0/1] files are formatted correctly.

file Fail to formatted

but uncrustify work from command line

$ uncrustify -q -l C --no-backup md.md
cat md.md

cat md.md

#Test
` ` ` c
int main() {
    int = 2;
    int b = 3;
}
` ` `

Does not handle spaces in arguments well

I'm trying to have cbfmt autoformat my C code blocks using clang-format with the following config:

[languages]
c = ["clang-format -style=\"{BasedOnStyle: Google, IndentWidth: 4, UseTab: Never, TabWidth: 4}\""]

However, it seems to split args on spaces without respecting the escaped quote. clang-format thinks that it has received 6 filenames which yields the error:

$ cbfmt -w test.md
[Error]: test.md:3 [c] -> [clang-format]
No such file or directory
No such file or directory
No such file or directory
No such file or directory
No such file or directory
No such file or directory
No such file or directory


[0/1] files were written.

Here's my test markdown file:

Hello

```c
struct MailStructure {
  unsigned int data : 18;  // Assuming data is 18 bits
  unsigned int reserved : 10;
  unsigned int channel : 4;
};
```

musl build is not static

The musl build in the releases is not statically built, it seems to be the same as the linux build.

I think the --target=x86_64-unknown-linux-musl option is needed for cargo build .

Config Files of the individual formatters not detected?

Thanks for this small nifty tool.

I was wondering how exactly one can use config files for the specific formatters? For example with stylua.

I runcbfmt as cbfmt --config "$some_path". The specified cbfmt.toml is correctly recognized, since adding / removing lua does make a difference. However, I cannot figure out how to make cbfmt make stylua use a config file.

I have a stylua.toml in the same directory as the cbfmt.toml, and also in the nvim-pwd when executting the formatting command (via null-ls). However, cbfmt-run-stylua does not seem to recognize it since it seems to run on default config.

my config example

[languages]
lua = ["stylua --search-parent-directories -"]

I mean, I could explicitly run add a --config to the cbfmt.toml, but that would be really cumbersome.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.