summaryrefslogtreecommitdiff
path: root/lib/python/qmk/cli
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2020-12-10 17:01:51 +0000
committerGitHub <noreply@github.com>2020-12-10 17:01:51 +0000
commit6c4b6531fe8fed46bec54fae993a1bab8246dd7d (patch)
treedbe9ad71cbccafee465545cdf7180e65694e4630 /lib/python/qmk/cli
parent82bb47a2f12429dda49886571173024cc8b80357 (diff)
CI: Add workflow for codebase formatting (#7382)
* Add workflow for codebase formatting * stash * review comments * Swap to a more complete push action
Diffstat (limited to 'lib/python/qmk/cli')
-rw-r--r--lib/python/qmk/cli/__init__.py1
-rw-r--r--lib/python/qmk/cli/fileformat.py13
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/python/qmk/cli/__init__.py b/lib/python/qmk/cli/__init__.py
index 10536bb230..372c40921a 100644
--- a/lib/python/qmk/cli/__init__.py
+++ b/lib/python/qmk/cli/__init__.py
@@ -14,6 +14,7 @@ from . import compile
from . import config
from . import docs
from . import doctor
+from . import fileformat
from . import flash
from . import generate
from . import hello
diff --git a/lib/python/qmk/cli/fileformat.py b/lib/python/qmk/cli/fileformat.py
new file mode 100644
index 0000000000..502a3b7b1f
--- /dev/null
+++ b/lib/python/qmk/cli/fileformat.py
@@ -0,0 +1,13 @@
+"""Format files according to QMK's style.
+"""
+from milc import cli
+
+import subprocess
+
+
+@cli.subcommand("Format files according to QMK's style.", hidden=True)
+def fileformat(cli):
+ """Run several general formatting commands.
+ """
+ dos2unix = subprocess.run(['bash', '-c', 'dos2unix **'])
+ return dos2unix.returncode