Lines Matching +full:pre +full:- +full:commit +full:- +full:config
2 * Copyright (c) 2021-2023, Arm Limited. All rights reserved.
4 * SPDX-License-Identifier: BSD-3-Clause
7 /* eslint-env es6 */
15 const ccConventionalChangelog = require("conventional-changelog-conventionalcommits/conventional-ch…
16 const ccParserOpts = require("conventional-changelog-conventionalcommits/parser-opts");
17 …st ccRecommendedBumpOpts = require("conventional-changelog-conventionalcommits/conventional-recomm…
18 const ccWriterOpts = require("conventional-changelog-conventionalcommits/writer-opts");
26 * Register a Handlebars helper that lets us generate Markdown lists that can support multi-line
30 Handlebars.registerHelper("tf-a-mdlist", function (indent, options) {
32 const first = spaces + "- ";
42 Handlebars.registerHelper("tf-a-concat", function () {
50 function writerOpts(config) { argument
64 const flattenedSections = flattenSections(config.sections);
70 Handlebars.registerHelper("tf-a-notes", function (noteGroups, options) {
76 notes: notes.filter(note => section.scopes?.includes(note.commit.scope)),
80 * Don't return a section if it contains no notes and no sub-sections.
93 sections: generateTemplateData(config.sections, noteGroup.notes),
95 … !flattenedSections.some(section => section.scopes?.includes(note.commit.scope))),
101 * Register a helper to return a restructured version of the commit groups that includes commits
104 Handlebars.registerHelper("tf-a-commits", function (commitGroups, options) {
110 commits: commits.filter(commit => section.scopes?.includes(commit.scope)),
114 * Don't return a section if it contains no notes and no sub-sections.
127 sections: generateTemplateData(config.sections, commitGroup.commits),
128 commits: commitGroup.commits.filter(commit =>
129 !flattenedSections.some(section => section.scopes?.includes(commit.scope))),
134 const writerOpts = ccWriterOpts(config)
143 Handlebars.registerPartial("commitUrl", config.commitUrlFormat);
144 Handlebars.registerPartial("compareUrl", config.compareUrlFormat);
145 Handlebars.registerPartial("issueUrl", config.issueUrlFormat);
151 const notePartial = readFileSync(resolve(__dirname, "./templates/note.hbs"), "utf-8");
152 …nst noteSectionPartial = readFileSync(resolve(__dirname, "./templates/note-section.hbs"), "utf-8");
153 …commitSectionPartial = readFileSync(resolve(__dirname, "./templates/commit-section.hbs"), "utf-8");
155 Handlebars.registerPartial("tf-a-note", notePartial);
156 Handlebars.registerPartial("tf-a-note-section", noteSectionPartial);
157 Handlebars.registerPartial("tf-a-commit-section", commitSectionPartial);
161 * similar to the pre-Conventional Commits TF-A changelog.
163 … writerOpts.mainTemplate = readFileSync(resolve(__dirname, "./templates/template.hbs"), "utf-8");
164 … writerOpts.headerPartial = readFileSync(resolve(__dirname, "./templates/header.hbs"), "utf-8");
165 … writerOpts.commitPartial = readFileSync(resolve(__dirname, "./templates/commit.hbs"), "utf-8");
166 … writerOpts.footerPartial = readFileSync(resolve(__dirname, "./templates/footer.hbs"), "utf-8");
168 writerOpts.transform = function (commit, context) { argument
172 * scopeless `build`-type changes and treat them as though they actually have the
176 if ((commit.type === "build") && (commit.scope == null)) {
177 commit.scope = "build";
181 * Fix up commit trailers, which for some reason are not correctly recognized and
185 commit.notes.forEach(note => {
186 const trailers = execa.sync("git", ["interpret-trailers", "--parse"], {
193 return ccWriterOptsTransform(commit, context);
203 const config = parameter || {};
206 ccConventionalChangelog(config),
207 ccParserOpts(config),
208 ccRecommendedBumpOpts(config),
209 writerOpts(config)