diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 2050512..2776d98 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -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/action@v3.0.1 + build: runs-on: ${{ matrix.os }} strategy: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..0c268fc --- /dev/null +++ b/.pre-commit-config.yaml @@ -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] diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index 84ff52b..088c013 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -18,4 +18,4 @@ } ], "version": 4 -} \ No newline at end of file +} diff --git a/.vscode/cspell.json b/.vscode/cspell.json index a1d157a..e9c85ce 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -4,6 +4,7 @@ "dictionaryDefinitions": [], "dictionaries": [], "words": [ + "autoupdate", "BKGND", "buildsystems", "buildtrees", diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 84094cf..d843b01 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -12,4 +12,4 @@ ], // List of extensions recommended by VS Code that should not be recommended for users of this workspace. "unwantedRecommendations": [] -} \ No newline at end of file +} diff --git a/.vscode/launch.json b/.vscode/launch.json index 37466fc..1e4ac2f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -40,4 +40,4 @@ ] }, ] -} \ No newline at end of file +} diff --git a/.vscode/settings.json b/.vscode/settings.json index 4ad5802..234e19e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -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 @@ -102,4 +105,4 @@ "xutility": "cpp", "fstream": "cpp" } -} \ No newline at end of file +} diff --git a/vcpkg.json b/vcpkg.json index 8211cf2..eb4a097 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -15,4 +15,4 @@ }, "sdl2" ] -} \ No newline at end of file +}