Closed werat closed 3 years ago
Setting inplace: False doesn't work and the action still works as if inplace: True.
inplace: False
inplace: True
- uses: DoozyX/clang-format-lint-action@0.10 with: inplace: False
This is because --inplace argument is defined as type=bool -- https://github.com/DoozyX/clang-format-lint-action/blob/v0.10/run-clang-format.py#L303
--inplace
type=bool
Everything is parsed as bool, expect for the empty string:
bool
In [1]: import argparse ...: parser = argparse.ArgumentParser() ...: parser.add_argument('-i', '--inplace', type=bool, default=False) Out[1]: <...> In [2]: parser.parse_args(['--inplace', 'True']) Out[2]: Namespace(inplace=True) In [3]: parser.parse_args(['--inplace', 'False']) Out[3]: Namespace(inplace=True) In [4]: parser.parse_args(['--inplace', '0']) Out[4]: Namespace(inplace=True) In [5]: parser.parse_args(['--inplace', '']) Out[5]: Namespace(inplace=False)
So as a workaround one can set inplace: "":
inplace: ""
- uses: DoozyX/clang-format-lint-action@0.10 with: inplace: ""
I can confirm the issue!
Setting
inplace: False
doesn't work and the action still works as ifinplace: True
.This is because
--inplace
argument is defined astype=bool
-- https://github.com/DoozyX/clang-format-lint-action/blob/v0.10/run-clang-format.py#L303Everything is parsed as
bool
, expect for the empty string:So as a workaround one can set
inplace: ""
: