Skip to content

Commit

Permalink
Add consistent newlines to JSON files, add pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
HexDecimal committed Aug 7, 2024
1 parent 905a5e9 commit fb5d17f
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 5 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pre-commit/[email protected]

build:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
ci:
autoupdate_schedule: quarterly
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-merge-conflict
- id: check-shebang-scripts-are-executable
- id: check-symlinks
- id: check-toml
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
hooks:
- id: clang-format
exclude_types: [json]
2 changes: 1 addition & 1 deletion .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
}
],
"version": 4
}
}
1 change: 1 addition & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"dictionaryDefinitions": [],
"dictionaries": [],
"words": [
"autoupdate",
"BKGND",
"buildsystems",
"buildtrees",
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
}
}
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@
]
},
]
}
}
5 changes: 4 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"C_Cpp.vcpkg.enabled": true,
"cmake.sourceDirectory": "${workspaceFolder}",
"editor.formatOnSave": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"editor.defaultFormatter": "xaver.clang-format",
"editor.rulers": [
120
Expand Down Expand Up @@ -102,4 +105,4 @@
"xutility": "cpp",
"fstream": "cpp"
}
}
}
2 changes: 1 addition & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@
},
"sdl2"
]
}
}

0 comments on commit fb5d17f

Please sign in to comment.