33 lines
847 B
Markdown
33 lines
847 B
Markdown
# CF Guesser
|
|
|
|
Clang Format guesser.
|
|
|
|
## Description
|
|
|
|
This is a script to find a clang-format configuration similar to the one used to
|
|
format a specific source file.
|
|
|
|
It works by formatting copies of the provided source file with each variant of each properties and keeping the variant that least modifies the source.
|
|
|
|
## Usage
|
|
|
|
### Dependencies
|
|
|
|
- [deno](https://deno.land/)
|
|
- [clang-format](https://clang.llvm.org/docs/ClangFormat.html) (comes with most distribution of clang)
|
|
|
|
```sh
|
|
./bin/cfguesser --help
|
|
# [cfguesser.ts] Usage: cfguesser <source_file> <config_output>
|
|
|
|
./bin/cfguesser source.c clang-format
|
|
# [cfguesser.ts] reading input from 'source.c'.
|
|
# [cfguesser.ts] scoring properties.
|
|
# [cfguesser.ts] Filtering guesses.
|
|
# [cfguesser.ts] Certainty 100 %
|
|
# [cfguesser.ts] writing config to 'clang-format'
|
|
```
|
|
|
|
### Building
|
|
|
|
`./build.sh`
|