refactor: Add more checks to pre-commit

Updated existing pre-commit hooks and added some new hooks:

- Remove trailing whitespace
- Ensure every non-empty file ends with a new line
- Check YAML file validity
- Prevent adding large files
- Ensure any scripts with shebangs are executable

Added a GitHub action to run pre-commit on every commit. Removed any
existing actions which duplicate pre-commit.

Ran pre-commit on the codebase.
This commit is contained in:
Joel Spadin
2023-04-22 23:16:36 -05:00
committed by Pete Johanson
parent 9c4f1e02d1
commit 32ae776c42
247 changed files with 759 additions and 797 deletions

View File

@@ -15,7 +15,7 @@ if SHIELD_ELEPHANT42_LEFT || SHIELD_ELEPHANT42_RIGHT
config ZMK_SPLIT
default y
if ZMK_DISPLAY
config I2C

View File

@@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: MIT
*/
#include <dt-bindings/zmk/matrix_transform.h>
/ {
@@ -36,7 +36,7 @@ RC(1,0) RC(1,1) RC(1,2) RC(1,3) RC(1,4) RC(1,5) RC(1,6) RC(1,7)
, <&pro_micro 7 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>
;
};
};
};
&pro_micro_i2c {

View File

@@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: MIT
*/
#include <behaviors.dtsi>
#include <dt-bindings/zmk/keys.h>
#include <dt-bindings/zmk/bt.h>
@@ -19,7 +19,7 @@
default_layer {
bindings = <
&lt ADJT ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp DEL
&lt ADJT ESC &kp Q &kp W &kp E &kp R &kp T &kp Y &kp U &kp I &kp O &kp P &kp DEL
&mt LCTRL TAB &kp A &kp S &kp D &kp F &kp G &kp H &kp J &kp K &kp L &kp SEMI &kp SQT
&kp Z &kp X &kp C &kp V &kp B &kp N &kp M &kp COMMA &kp DOT &kp FSLH
&kp LSHFT &mo LOWR &kp LGUI &kp BSPC &kp SPACE &kp ENTER &mo RAIS &kp LALT

View File

@@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: MIT
*/
#include "elephant42.dtsi"
&kscan0 {

View File

@@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: MIT
*/
#include "elephant42.dtsi"
&default_transform {