Skip to content

Commit

Permalink
add docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jr1221 committed Jun 18, 2024
1 parent 8bf08dd commit 90955bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ You can sponsor me [here](https://github.com/sponsors/jidicula)!
* `include-regex` [optional]: A regex to include files or directories that should be checked.
* Default: see [`INCLUDE_REGEX`](./check.sh#77)
* Pattern matching is done with a POSIX `grep -E` extended regex, **not** a glob expression. You can exclude multiple patterns like this: `(hello|world)`. Build and verify your regex at [regex101.com](https://regex101.com) ([example](https://regex101.com/r/llFcLy/7)).
* `format-filepath` [optional]: A filepath to the clang_format file to override the default, which is `.clang_format` in the directory closest to the parent.'
* `format-filepath` [optional]: A filepath to the clang_format file to override the default, which is `.clang_format` file located in the closest parent directory of the input file.'
default: ''

This action checks all C/C++/Protobuf (including Arduino `.ino` and `.pde`) files in the provided directory in the GitHub workspace are formatted correctly using `clang-format`. If no directory is provided or the provided path is not a directory in the GitHub workspace, all C/C++/Protobuf files are checked.
Expand Down
3 changes: 2 additions & 1 deletion check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,10 @@ if [[ ! -d $CHECK_PATH ]]; then
fi

if [[ ! -f $FORMAT_FILEPATH ]]; then
echo "Not a file in the workspace, fallback to .clang_format." >&2
echo "Not a file in the workspace, fallback to search for .clang_format." >&2
FORMAT_FILEPATH=""
else
# if being used, add the colon for seperating the syntax file:<file_name>
FORMAT_FILEPATH=":$FORMAT_FILEPATH"
fi

Expand Down

0 comments on commit 90955bb

Please sign in to comment.