GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - conventionalcommit/parser: A go parser for Conventional Commits message

BranchesTags
Open more actions menu

Latest commit

 

History

49 Commits
49 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
testdata
testdata
 
 
.gitignore
.gitignore
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
commit.go
commit.go
 
 
example_test.go
example_test.go
 
 
go.mod
go.mod
 
 
go.sum
go.sum
 
 
lexer.go
lexer.go
 
 
lexer_state.go
lexer_state.go
 
 
parser.go
parser.go
 
 
parser_bench_test.go
parser_bench_test.go
 
 
parser_header_test.go
parser_header_test.go
 
 
parser_test.go
parser_test.go
 
 

Repository files navigation

Parser

A go parser for Conventional Commits messages

PkgGoDevGitHub go.mod Go version

Usage

var msg = `feat(scope): description

this is first line in body

this is second line in body

Ref #123
Date: 01-01-2021
By: John Doe`

commit, err := Parse(msg)
if err != nil {
    fmt.Printf("Error: %s", err.Error())
}
fmt.Printf("%#v", commit)

/*
commitMsg = &parser.Commit{
    message:     "feat(scope): description\n\nthis is first line in body\n\nthis is second line in body\n\nRef #123\nDate: 01-01-2021\nBy: John Doe",
    header:      "feat(scope): description",
    body:        "this is first line in body\n\nthis is second line in body",
    footer:      "Ref #123\nDate: 01-01-2021\nBy: John Doe",
    commitType:  "feat",
    scope:       "scope",
    description: "description",
    notes:       {
        {token:"Ref", value:"123"},
        {token:"Date", value:"01-01-2021"},
        {token:"By", value:"John Doe"},
    },
    isBreakingChange: false,
}
*/

TODO

  • More Test Cases
  • Benchmark

Attribution

This parser is inspired and forked from

  • cc by Rene Zbinden
  • go-lexer by Brandon Buck
  • cov-commit-parser by Matthew Bamber

License

MIT License

About

A go parser for Conventional Commits message

Topics

conventional-commitconventional-commitsgogolangparser

Resources

Readme
MIT license
Activity
Custom properties

Stars

3 stars

Watchers

0 watching

Forks

2 forks
Report repository

Releases

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.