New functionality for cformat (#7893)

Fixing complexity

remove lambda

PR review fixes #1

Removing unneccesary string substitution

Handle -a and specified files

Complexity rewrite, use pathlib
This commit is contained in:
Akaash Suresh 2020-02-22 22:57:19 -06:00 committed by GitHub
parent eb9c2429c6
commit b353028ea5
Failed to generate hash of commit
4 changed files with 82 additions and 26 deletions

View file

@ -71,14 +71,36 @@ There are some limitations to the local CLI compared to the global CLI:
## `qmk cformat`
This command formats C code using clang-format. Run it with no arguments to format all core code, or pass filenames on the command line to run it on specific files.
This command formats C code using clang-format.
**Usage**:
Run it with no arguments to format all core code that has been changed. Default checks `origin/master` with `git diff`, branch can be changed using `-b <branch_name>`
Run it with `-a` to format all core code, or pass filenames on the command line to run it on specific files.
**Usage for specified files**:
```
qmk cformat [file1] [file2] [...] [fileN]
```
**Usage for all core files**:
```
qmk cformat -a
```
**Usage for only changed files against origin/master**:
```
qmk cformat
```
**Usage for only changed files against branch_name**:
```
qmk cformat -b branch_name
```
## `qmk compile`
This command allows you to compile firmware from any directory. You can compile JSON exports from <https://config.qmk.fm>, compile keymaps in the repo, or compile the keyboard in the current working directory.