Skip to content

Commit

Permalink
fix: wrong yamllint skip
Browse files Browse the repository at this point in the history
Fixes by splitting the string and iterating over it
  • Loading branch information
danctorres committed Nov 15, 2024
1 parent 431d135 commit 8063ced
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/yamllint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,15 @@ jobs:
pip install yamllint
- name: Lint YAML files
run: |-
if echo "${{ steps.changed_files.outputs.all }}" | grep -qE '\.(yml|yaml)$'; then
IFS=' ' read -r -a files <<< "${{ steps.changed_files.outputs.all }}"
yaml_files=()
for file in "${files[@]}"; do
if [[ "$file" == *.yaml || "$file" == *.yml ]]; then
yaml_files+=("$file")
fi
done
if [ ${#yaml_files[@]} -gt 0 ]; then
echo -e "Running yamllint"
yamllint . || exit 1
else
Expand Down
2 changes: 1 addition & 1 deletion examples/cpp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ cc_test(
name = "test",
srcs = ["test.cpp"],
deps = [
":lib",
"@googletest//:gtest",
"@googletest//:gtest_main",
":lib",
],
)
4 changes: 3 additions & 1 deletion examples/cpp/hello.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <string>

auto greet() -> std::string { return "Hello World!"; }
std::string greet( ){
return "Hello World!";
}

auto farewell() -> std::string { return "Bye World!"; }
2 changes: 1 addition & 1 deletion examples/cpp/hello.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <string>

auto greet() -> std::string;
std::string greet();
auto farewell() -> std::string;

0 comments on commit 8063ced

Please sign in to comment.