Skip to content

Commit

Permalink
First Version Of Nitroxomat
Browse files Browse the repository at this point in the history
The first version of the minimalistic nitrox calculator Nitroxomat.
  • Loading branch information
borisboesler committed Jun 8, 2022
1 parent ef8cf51 commit aeb41aa
Show file tree
Hide file tree
Showing 50 changed files with 2,568 additions and 24 deletions.
161 changes: 161 additions & 0 deletions .chglog/CHANGELOG.tpl.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
dnl
<!-- this is a generated file -->

dnl change comment marker (#,\n) -> (/*,*/)
changecom(/*,*/)

dnl
dnl Template to emit the commits' refs
dnl
define(
CHGLOG_COMMIT_REFS,
{{- if .Refs }}
{{- range .Refs }}[(#{{ .Ref }})]({{ $.Info.RepositoryURL }}/-/issues/{{ .Ref }}){{ end -}}
{{ end }})


dnl
dnl Template to emit the subject
dnl
define(
CHGLOG_COMMIT_SUBJECT,
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }})


dnl
dnl Template to emit the subject with references
dnl
define(
CHGLOG_COMMIT_SUBJECT_WITH_REFS,
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
CHGLOG_COMMIT_REFS)


dnl
dnl Template to emit the commits' mentions
dnl
define(
CHGLOG_COMMIT_MENTIONS,
{{ if .Mentions }}
dnl need 4 spaces
Mentions: {{ .Mentions }}
{{ end -}})


dnl
dnl Template to emit all signers in a commit
dnl
define(
CHGLOG_COMMIT_SIGNER_ENTRIES,
{{ if .Signers }}
dnl need 4 spaces
Signed Off By:
{{- range .Signers }}
- {{ .Name }} ({{ .Email }})
{{ end -}}
{{ end -}})


dnl
dnl Template to emit all co-autors in a commit
dnl
define(
CHGLOG_COMMIT_COAUTHORS_ENTRIES,
{{ if .CoAuthors }}
dnl need 4 spaces
Co-authored by:
{{- range .CoAuthors }}
- {{ .Name }} ({{ .Email }})
{{ end -}}
{{ end -}})


dnl
dnl Template to emit the commits' notes
dnl
define(
CHGLOG_COMMIT_NOTES,
{{ if .Notes }}
dnl need 4 spaces
{{- range .Notes }}
**{{ .Title }}**: {{ .Body }}
{{ end -}}
{{ end -}})


dnl
dnl Template to emit a commit entry
dnl
define(
CHGLOG_COMMITGROUP_ENTRY,
### {{ .Title }}
{{ range .Commits -}}
dnl CHGLOG_COMMIT_SUBJECT
CHGLOG_COMMIT_SUBJECT_WITH_REFS
CHGLOG_COMMIT_MENTIONS
CHGLOG_COMMIT_SIGNER_ENTRIES
CHGLOG_COMMIT_COAUTHORS_ENTRIES
CHGLOG_COMMIT_NOTES
{{ end }})



dnl
dnl The template to emit the full CHANGELOG
dnl
{{- if .Info.Title }}
# CHANGELOG for *{{ .Info.Title }}*
{{- end }}

{{ if .Versions -}}
<a name="Unreleased"></a>
## [Unreleased]

{{ if .Unreleased.CommitGroups -}}
{{ range .Unreleased.CommitGroups -}}
CHGLOG_COMMITGROUP_ENTRY
{{ end -}}
{{ end -}}
{{ end -}} dnl {{ if .Versions -}}

{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
{{ range .CommitGroups -}}
CHGLOG_COMMITGROUP_ENTRY
{{ end -}} dnl {{ range .CommitGroups -}}

{{- if .RevertCommits -}}
### Reverts
{{ range .RevertCommits -}}
- {{ .Revert.Header }}
{{ end }} dnl {{ range .RevertCommits -}}
{{ end -}} dnl {{- if .RevertCommits -}}

{{- if .MergeCommits -}}
### Merge Requests
{{ range .MergeCommits -}}
- {{ .Header }}
{{ end }} dnl {{ range .MergeCommits -}}
{{ end -}} dnl {{- if .MergeCommits -}}

{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }} dnl {{ range .Notes }}
{{ end -}} dnl {{ range .NoteGroups -}}
{{ end -}} dnl {{- if .NoteGroups -}}
{{ end -}} dnl {{ range .Versions }}


dnl create links into the gitlab view of the repository
{{- if .Versions }}
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
{{ range .Versions -}}
{{ if .Tag.Previous -}}
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
{{ end -}}
{{ end -}}
{{ end -}}
126 changes: 126 additions & 0 deletions .chglog/CHANGELOG.tpl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
<!-- this is a generated file -->




























{{- if .Info.Title }}
# CHANGELOG for *{{ .Info.Title }}*
{{- end }}

{{ if .Versions -}}
<a name="Unreleased"></a>
## [Unreleased]

{{ if .Unreleased.CommitGroups -}}
{{ range .Unreleased.CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{- if .Refs }}
{{- range .Refs }}[(#{{ .Ref }})]({{ $.Info.RepositoryURL }}/-/issues/{{ .Ref }}){{ end -}}
{{ end }}
{{ if .Mentions }}
Mentions: {{ .Mentions }}
{{ end -}}
{{ if .Signers }}
Signed Off By:
{{- range .Signers }}
- {{ .Name }} ({{ .Email }})
{{ end -}}
{{ end -}}
{{ if .CoAuthors }}
Co-authored by:
{{- range .CoAuthors }}
- {{ .Name }} ({{ .Email }})
{{ end -}}
{{ end -}}
{{ if .Notes }}
{{- range .Notes }}
**{{ .Title }}**: {{ .Body }}
{{ end -}}
{{ end -}}
{{ end }}
{{ end -}}
{{ end -}}
{{ end -}}
{{ range .Versions }}
<a name="{{ .Tag.Name }}"></a>
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]{{ else }}{{ .Tag.Name }}{{ end }} - {{ datetime "2006-01-02" .Tag.Date }}
{{ range .CommitGroups -}}
### {{ .Title }}
{{ range .Commits -}}
- {{ if .Scope }}**{{ .Scope }}:** {{ end }}{{ .Subject }}
{{- if .Refs }}
{{- range .Refs }}[(#{{ .Ref }})]({{ $.Info.RepositoryURL }}/-/issues/{{ .Ref }}){{ end -}}
{{ end }}
{{ if .Mentions }}
Mentions: {{ .Mentions }}
{{ end -}}
{{ if .Signers }}
Signed Off By:
{{- range .Signers }}
- {{ .Name }} ({{ .Email }})
{{ end -}}
{{ end -}}
{{ if .CoAuthors }}
Co-authored by:
{{- range .CoAuthors }}
- {{ .Name }} ({{ .Email }})
{{ end -}}
{{ end -}}
{{ if .Notes }}
{{- range .Notes }}
**{{ .Title }}**: {{ .Body }}
{{ end -}}
{{ end -}}
{{ end }}
{{ end -}}
{{- if .RevertCommits -}}
### Reverts
{{ range .RevertCommits -}}
- {{ .Revert.Header }}
{{ end }} {{ end -}}
{{- if .MergeCommits -}}
### Merge Requests
{{ range .MergeCommits -}}
- {{ .Header }}
{{ end }} {{ end -}}
{{- if .NoteGroups -}}
{{ range .NoteGroups -}}
### {{ .Title }}
{{ range .Notes }}
{{ .Body }}
{{ end }} {{ end -}} {{ end -}} {{ end -}}

{{- if .Versions }}
[Unreleased]: {{ .Info.RepositoryURL }}/compare/{{ $latest := index .Versions 0 }}{{ $latest.Tag.Name }}...HEAD
{{ range .Versions -}}
{{ if .Tag.Previous -}}
[{{ .Tag.Name }}]: {{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}
{{ end -}}
{{ end -}}
{{ end -}}
20 changes: 20 additions & 0 deletions .chglog/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Project: Nitroxomat
# File name: .chglog/Makefile
# Purpose: generate the CHANGELOG.tpl.md from a template
# Author: Boris Boesler
# Modified by:
# Created: 08.06.2022
# Copyright: (c) 2022 Boris Boesler


# tools
M4 = m4

# files
CLTemplateTemplate = CHANGELOG.tpl.m4
CLTemplate = CHANGELOG.tpl.md

all: $(CLTemplate)

%.md: %.m4
$(M4) $^ > $@
62 changes: 62 additions & 0 deletions .chglog/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
style: none
template: CHANGELOG.tpl.md
info:
title: Nitroxomat
repository_url: https://github.com/borisboesler/Nitroxomat.git
options:
sort: date
commits:
filters:
Type:
- docs
- chore
- feat
- fix
- perf
- refactor
- style
- test

commit_groups:
group_by: Type
sort_by: Title
title_maps:
docs: Documention
chore: Chores
feat: Features
fix: Bug Fixes
perf: Performance Improvements
refactor: Code Refactoring
style: Reformating
test: Tests

header:
pattern: "^(\\w*)(?:\\((.+)\\))?\\:\\s(.+)$"
pattern_maps:
- Type
- Scope
- Subject

issues:
prefix:
- "#"

refs:
actions:
- Closes
- Fixes

merges:
pattern: "^Merge branch ('.*'.*) into (.*)$"
pattern_maps:
- Source
- Ref

reverts:
pattern: "^Revert \"([\\s\\S]*)\"$"
pattern_maps:
- Header

notes:
keywords:
- BREAKING CHANGE
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# copy from
# https://github.com/petervanderdoes/gitflow-avh/blob/develop/.gitattributes

* text=auto

*.awk text eol=lf
*.sed text eol=lf
*.sh text eol=lf
Loading

0 comments on commit aeb41aa

Please sign in to comment.