Everduin94 / better-commits

A CLI for creating better commits following the conventional commits specification

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compatible with overcommit

harssh opened this issue · comments

commented

First, thank you for this fantastic tool.

Just checking if there is a way to make it work with https://github.com/sds/overcommit

I tried twice but it's not evoking overcommit.

I've never used overcommit, looking at the docs (I'm assuming this is a pre-commit hook), I believe it is anticipating git commit.

Can you try this as a test for me? -- Run git commit -m "message" -e. Does that fire the overcommit hook?

If so, I believe there is a change I can try. If not, I don't think it's going to work.

Edit: I tried testing this with a pre-commit hook I use at work. I believe it's husky, not overcommit, should be similar though.

Are you sure the hook didn't work? -- I think better-commits might be throwing away the output but the hook may still have ran (at least it is in my case). Can you try to verify this as well? And if that's the case I have a few things I can try.

commented

Getting below output

git commit -m "message" -e
Running pre-commit hooks
Analyze with RailsBestPractices..................[RailsBestPractices] OK
Analyze with RuboCop........................................[RuboCop] FAILED
Unexpected output: unable to determine line number or type of error/warning for output:
Inspecting 1 file
C

But with better-commit it just silently fails to commit if there are offenses.

◇ Found global config
┌ better-commits

◇ Found global config

◇ Checking Git Status

◆ Changes to be committed:
│ lib/tasks/db/db.rake

◇ Select a commit type
│ refactor

◇ Select a commit scope
│ app

◇ Ticket / issue infered from branch (confirm / edit)
│ tik-5397

◇ Write a brief title describing the commit
│ test commit

◇ Write a detailed description of the changes (optional)


◇ Select optional footers ( to select)
│ custom

◇ Write a custom footer
│ test

◇ Commit Preview ──────────────────────╮
│ │
│ refactor(app): tik-5397 test commit │
│ │
│ test │
│ │
├───────────────────────────────────────╯

◇ Confirm Commit?
│ Yes

After pressing enter no output appears, and the commit won;t actually happen.

@harssh -- I created 1.0.8-print-output. -- Its also the latest release so if you just update you should get the changes. Could you install and test it for me?

Edit: I tested at my work with our husky pre-commit hooks and it works for me

commented

@Everduin94 Yes working now.

Awesome.