Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check text on stdin #100

Closed
dpc opened this issue Jan 12, 2023 · 2 comments
Closed

Check text on stdin #100

dpc opened this issue Jan 12, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@dpc
Copy link

dpc commented Jan 12, 2023

Is your feature request related to a problem? Please describe.

I'd like to check the commit message in commit-msg git hook, which ideally would just invoke echo "$1" | convco check --stdin or something like that.

Yes, I know there's convco commit but not everyone will necessarily use it in my team, while git hooks are set up automatically.

Describe the solution you'd like
echo "$1" | convco check --stdin should validate the input.

Describe alternatives you've considered
Joining monastery and dedicating my life towards study of scriptures and meditation.

Additional context
That's really all I have. Thank you for making this project.

@dpc dpc added the enhancement New feature or request label Jan 12, 2023
hdevalke added a commit that referenced this issue Jan 12, 2023
This is usefull to use convco in a commit-msg git hook.

```
printf '%s' "$1" | convco check
```

Refs: #100
@hdevalke
Copy link
Collaborator

Thank you for the suggestion. I added it in db1c946.
I will release soon.

It works without providing an extra argument:

❯ git log -1 --format=%B | cargo run -q -- check && echo $?
0
❯ cargo run -q -- check <<< bad || echo $?
first line doesn't match `<type>[optional scope]: <description>`
1
❯ cargo run -q -- check
FAIL  38be02d  wrong type: doc  doc: clarify cmake is needed to build
FAIL  8c4dbb6  wrong type: doc  doc: improve gitlab section in `README.m...
FAIL  ffcf34a  scope does not match regex: changelog|check|commit|version  ci(docker): Add a dockerfile
FAIL  724bb2b  first line doesn't match `<type>[optional scope]: <description>`  release v0.3.0
FAIL  155e652  scope does not match regex: changelog|check|commit|version  build(deps): bump versions

5/166 failed

hdevalke added a commit that referenced this issue Jan 12, 2023
This is usefull to use convco in a commit-msg git hook.

```
printf '%s' "$1" | convco check
```

Refs: #100
@dpc
Copy link
Author

dpc commented Jan 12, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants