Skip to content

Commit 28bf7ac

Browse files
committed
chore: address PR review feedback
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: passed - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: passed - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: na - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed ---
1 parent b2fcb9b commit 28bf7ac

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

.github/workflows/generate_monthly_changelog.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,14 @@ jobs:
105105
var generate = require( '@stdlib/_tools/changelog/generate' );
106106
var changelog = generate( '@stdlib', {
107107
'flags': {
108-
'since': '$UNTIL - 1 week',
108+
'since': '$UNTIL - 1 month',
109109
'until': '$UNTIL'
110110
},
111111
'format': 'aggregated'
112112
});
113113
console.log( changelog.content );
114-
" > ./www-blog-monthly-changelog/monthly_changelog_$UNTIL.md
114+
115+
" > ./www-blog-monthly-changelog/monthly_changelog_${UNTIL//-/_}.md
115116
116117
# Import GPG key to sign commits:
117118
- name: 'Import GPG key to sign commits'

lib/node_modules/@stdlib/_tools/changelog/generate/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ The function returns an object with the following properties:
4747
The function accepts the following `options`:
4848

4949
- **releaseType**: a release type for which to generate the changelog.
50+
5051
- **format**: changelog format. Must be one of the following:
5152

5253
- `'grouped'`: group commits by package.
5354
- `'aggregated'`: TODO:add description.
55+
5456
- **flags**: `git log` options used to retrieve commits from which to generate the changelog.
5557

5658
By default, the changelog is generated for a non-release. To generate a changelog for an upcoming release, provide a valid release type:
@@ -97,12 +99,12 @@ changelog = generate( '@stdlib/math/base/utils', {
9799

98100
When generating a changelog, the function uses `git log` to retrieve the commits from which to assemble a set of changes. The `flags` option allows passing options to directly to the `git log` command (e.g., to generate a changelog for a specified time interval or for an individual contributor).
99101

100-
<!-- eslint-disable stdlib/doctest -->
102+
<!-- eslint-disable -->
101103

102104
```javascript
103105
var changelog = generate( '@stdlib/ndarray', {
104106
'flags': {
105-
'since': 'last month'
107+
'since': 'last year'
106108
}
107109
});
108110
// returns {...}
@@ -121,8 +123,6 @@ changelog = generate( '@stdlib/ndarray', {
121123

122124
<section class="notes">
123125

124-
- When `flags` are supplied, the generated changelog does not include empty releases and uses a flat output format.
125-
126126
</section>
127127

128128
<!-- /.notes -->

lib/node_modules/@stdlib/_tools/changelog/generate/lib/validate.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,14 @@ var isObject = require( '@stdlib/assert/is-plain-object' );
2424
var hasOwnProp = require( '@stdlib/assert/has-own-property' );
2525
var isString = require( '@stdlib/assert/is-string' ).isPrimitive;
2626
var isPlainObject = require( '@stdlib/assert/is-plain-object' );
27-
var indexOf = require( '@stdlib/utils/index-of' );
27+
var contains = require( '@stdlib/array/base/assert/contains' ).factory;
2828
var format = require( '@stdlib/string/format' );
2929

3030

3131
// VARIABLES //
3232

3333
var FORMAT_OPTIONS = [ 'grouped', 'aggregated' ];
34+
var isFormat = contains( FORMAT_OPTIONS );
3435

3536

3637
// MAIN //
@@ -42,7 +43,7 @@ var FORMAT_OPTIONS = [ 'grouped', 'aggregated' ];
4243
* @param {Object} opts - destination for function options
4344
* @param {Options} options - function options
4445
* @param {string} [options.releaseType] - release type
45-
* @param {string} [options.format] - output format (`grouped` or `aggregated`)
46+
* @param {string} [options.format] - output format
4647
* @param {string} [options.flags] - `git log` options used to retrieve commits
4748
* @returns {(Error|null)} error or null
4849
*
@@ -68,7 +69,7 @@ function validate( opts, options ) {
6869
}
6970
if ( hasOwnProp( options, 'format' ) ) {
7071
opts.format = options.format;
71-
if ( indexOf( FORMAT_OPTIONS, opts.format ) === -1 ) {
72+
if ( !isFormat( opts.format ) ) {
7273
return new TypeError( format( 'invalid option. `%s` option must be one of the following: "%s". Option: `%s`.', 'format', FORMAT_OPTIONS.join( '", "' ), opts.format ) );
7374
}
7475
}

0 commit comments

Comments
 (0)