Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Blackfaded committed Aug 23, 2024
2 parents a4dabc5 + 1f7dd2d commit 75a0441
Show file tree
Hide file tree
Showing 5 changed files with 2,306 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ Thumbs.db

#tests
TestResults/
node_modules
80 changes: 80 additions & 0 deletions changelog.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
const fs = require('fs');

const customTransform = (commit, context) => {
const transformedCommit = { ...commit };

switch (transformedCommit.type) {
case 'feat':
transformedCommit.customGroup = 'Features';
break;
case 'feature':
transformedCommit.customGroup = 'Features';
break;
case 'fix':
transformedCommit.customGroup = 'Bug Fixes';
break;
case 'docs':
transformedCommit.customGroup = 'Documentation';
break;
default:
transformedCommit.customGroup = null;
}

return transformedCommit;
};

module.exports = {
writerOpts: {
transform: customTransform,
groupBy: 'customGroup',
commitGroupsSort: 'title',
commitsSort: ['scope', 'subject'],
mainTemplate: `{{> header}}
{{#each commitGroups}}
{{#if title}}
### {{title}}
{{#each commits}}
{{> commit root=@root}}
{{/each}}
{{/if}}
{{/each}}
{{> footer}}
`,
headerPartial: `{{#if isPatch~}}
##
{{~else~}}
#
{{~/if}} {{#if @root.linkCompare~}}
[{{version}}](
{{~#if @root.repository~}}
{{~#if @root.host}}
{{[email protected]}}/
{{~/if}}
{{~#if @root.owner}}
{{[email protected]}}/
{{~/if}}
{{[email protected]}}
{{~else}}
{{[email protected]}}
{{~/if~}}
/compare/{{previousTag}}...{{currentTag}})
{{~else}}
{{~version}}
{{~/if}}
{{~#if title}} "{{title}}"
{{~/if}}
{{~#if date}} ({{date}})
{{/if}}
`,
},
hooks: {
postbump: () => {
const path = 'CHANGELOG.md';
if (!fs.existsSync(path)) {
fs.writeFileSync(path, '', 'utf8');
}
},
},
};
39 changes: 39 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# EXAMPLE USAGE:
#
# Refer for explanation to following link:
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md
#
# pre-push:
# commands:
# packages-audit:
# tags: frontend security
# run: yarn audit
# gems-audit:
# tags: backend security
# run: bundle audit
#
# pre-commit:
# parallel: true
# commands:
# eslint:
# glob: "*.{js,ts,jsx,tsx}"
# run: yarn eslint {staged_files}
# rubocop:
# tags: backend style
# glob: "*.rb"
# exclude: '(^|/)(application|routes)\.rb$'
# run: bundle exec rubocop --force-exclusion {all_files}
# govet:
# tags: backend style
# files: git ls-files -m
# glob: "*.go"
# run: go vet {files}
# scripts:
# "hello.js":
# runner: node
# "any.go":
# runner: go run
commit-msg:
scripts:
commitlint:
runner: npx commitlint --edit
Loading

0 comments on commit 75a0441

Please sign in to comment.