Add pre-commit config and auto-format files

This commit is contained in:
Leroy Hopson 2024-02-13 09:50:18 +13:00
parent 6ce0e6d01c
commit e8650c5bc2
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
22 changed files with 383 additions and 363 deletions

View file

@ -1,4 +1,4 @@
# Git hooks for GodotXterm
# Git hooks for GodotXterm
This folder contains git hooks meant to be installed locally by GodotXterm
contributors to make sure they comply with our requirements.

View file

@ -1,88 +1,80 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Main (gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "/run/current-system/sw/bin/godot",
"args": ["${workspaceFolder}/examples/menu/menu.tscn"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"name": "Main (gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "/run/current-system/sw/bin/godot",
"args": [
"${workspaceFolder}/examples/menu/menu.tscn",
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true,
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true,
},
],
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
}
]
},
{
"name": "Editor (gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "/run/current-system/sw/bin/godot",
"args": ["--editor"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"name": "Editor (gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "/run/current-system/sw/bin/godot",
"args": [
"--editor",
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true,
},
{
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true,
},
{
"description": "Debug forked child process",
"text": "-gdb-set follow-fork-mode child",
},
],
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
},
{
"name": "Test (gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "/run/current-system/sw/bin/godot",
"args": [
"--no-window",
"-s",
"addons/gut/gut_cmdln.gd"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true,
},
],
"description": "Set Disassembly Flavor to Intel",
"text": "-gdb-set disassembly-flavor intel",
"ignoreFailures": true
},
],
{
"description": "Debug forked child process",
"text": "-gdb-set follow-fork-mode child"
}
]
},
{
"name": "Test (gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "/run/current-system/sw/bin/godot",
"args": ["--no-window", "-s", "addons/gut/gut_cmdln.gd"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
}

View file

@ -1,23 +1,23 @@
{
"editor.formatOnSave": true,
"clang-format.executable": "/run/current-system/sw/bin/clang-format",
"gut-extension.additionalOptions": "-d --no-window",
"nixEnvSelector.nixShellConfig": "NOT_MODIFIED_ENV",
"files.associations": {
"array": "cpp",
"istream": "cpp",
"limits": "cpp",
"numeric": "cpp",
"sstream": "cpp",
"streambuf": "cpp",
"utility": "cpp",
"optional": "cpp",
"ostream": "cpp",
"ratio": "cpp",
"system_error": "cpp",
"functional": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"*.inc": "cpp"
}
"editor.formatOnSave": true,
"clang-format.executable": "/run/current-system/sw/bin/clang-format",
"gut-extension.additionalOptions": "-d --no-window",
"nixEnvSelector.nixShellConfig": "NOT_MODIFIED_ENV",
"files.associations": {
"array": "cpp",
"istream": "cpp",
"limits": "cpp",
"numeric": "cpp",
"sstream": "cpp",
"streambuf": "cpp",
"utility": "cpp",
"optional": "cpp",
"ostream": "cpp",
"ratio": "cpp",
"system_error": "cpp",
"functional": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"*.inc": "cpp"
}
}

View file

@ -1,24 +1,17 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/addons/godot_xterm/native",
},
"command": "nix-shell",
"args": [
"-I",
"nixpkgs=~/nixpkgs",
"-p",
"scons",
"--run",
"./build.sh"
],
"problemMatcher": []
}
]
}
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"options": {
"cwd": "${workspaceFolder}/addons/godot_xterm/native"
},
"command": "nix-shell",
"args": ["-I", "nixpkgs=~/nixpkgs", "-p", "scons", "--run", "./build.sh"],
"problemMatcher": []
}
]
}