Commit 58378e7

mo khan <mo@mokhan.ca>
2021-02-07 20:04:18
feat: add subcommand to print semantic commit help
1 parent f2e1463
Changed files (1)
lib
lib/jive/cli.rb
@@ -11,6 +11,14 @@ module Jive
     class App < Thor
       package_name "jive"
 
+      def self.exit_on_failure?
+        true
+      end
+
+      def self.handle_no_command_error(name)
+        ::Jive::Cli::App.start(["exec", name])
+      end
+
       desc "docker SUBCOMMAND ...ARGS", "docker commands"
       subcommand "docker", (Class.new(Thor) do
         desc "build", "build the Dockerfile in the current directory"
@@ -29,13 +37,32 @@ module Jive
         end
       end)
 
-      def self.exit_on_failure?
-        true
-      end
+      desc "git SUBCOMMAND ...ARGS", "git commands"
+      subcommand "git", (Class.new(Thor) do
+        desc "semantic", "Print help for semantic commit messages"
+        def semantic
+          say <<~MESSAGE
+            Format: <type>(<scope>): <subject>
 
-      def self.handle_no_command_error(name)
-        ::Jive::Cli::App.start(["exec", name])
-      end
+            <scope> is optional
+
+            feat: add hat wobble
+            ^--^  ^------------^
+            |     |
+            |     +-> Summary in present tense.
+            |
+            +-------> Type: chore, docs, feat, fix, refactor, style, or test.
+
+            chore: updating grunt tasks etc; no production code change
+            docs: changes to the documentation
+            feat: new feature for the user, not a new feature for build script
+            fix: bug fix for the user, not a fix to a build script
+            refactor: refactoring production code, eg. renaming a variable
+            style: formatting, missing semi colons, etc; no production code change
+            test: adding missing tests, refactoring tests; no production code change
+          MESSAGE
+        end
+      end)
 
       desc "cd <org>/<project>", "cd to ~/src/github.com/<org>/<project>"
       def cd(slug)