Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{bats,sh,yml,yaml}]
indent_size = 2
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
tests/ export-ignore
.github/ export-ignore
.gitattributes export-ignore
.editorconfig export-ignore
16 changes: 16 additions & 0 deletions .github/scripts/update-checker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,19 @@ check_file_formatting() {
done < <(git ls-files -z 2>/dev/null | grep -zv '^tests/testdata/')
}

# Check .editorconfig
check_editorconfig() {
local editorconfig=".editorconfig"

if [[ -f "$editorconfig" ]]; then
if ! grep -q "charset = utf-8" "$editorconfig"; then
actions+=("$editorconfig should contain 'charset = utf-8', see upstream file $UPSTREAM/$editorconfig")
fi
else
actions+=("$editorconfig is missing, see upstream file $UPSTREAM/$editorconfig")
fi
}

# Main function
main() {
if [[ ! -f "install.yaml" ]]; then
Expand Down Expand Up @@ -400,6 +413,9 @@ main() {
# Check file formatting
check_file_formatting

# Check .editorconfig
check_editorconfig

# Display info messages if any
if [[ ${#info_messages[@]} -gt 0 ]]; then
echo "INFO:" >&2
Expand Down