-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add standard-version and changelog generator
- Loading branch information
Showing
10 changed files
with
5,637 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
module.exports = { | ||
tagPrefix: '', | ||
infile: 'CHANGELOG.md', | ||
preset: { | ||
name: 'conventionalcommits' | ||
}, | ||
bumpFiles: [ | ||
{ | ||
filename: 'lc-lib/core/version.go', | ||
updater: 'contrib/version-updaters/version.go.js' | ||
}, | ||
{ | ||
filename: 'ruby/log-courier/lib/log-courier/version.rb', | ||
updater: 'contrib/version-updaters/version.rb.js' | ||
}, | ||
{ | ||
filename: 'ruby/log-courier/log-courier.gemspec', | ||
updater: 'contrib/version-updaters/gemspec.js' | ||
}, | ||
{ | ||
filename: 'ruby/logstash-input-courier/logstash-input-courier.gemspec', | ||
updater: 'contrib/version-updaters/gemspec.js' | ||
}, | ||
{ | ||
filename: 'ruby/logstash-output-courier/logstash-output-courier.gemspec', | ||
updater: 'contrib/version-updaters/gemspec.js' | ||
} | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
rules: { | ||
// Disable subject-case | ||
'subject-case': [ | ||
0, | ||
'never', | ||
['sentence-case', 'start-case', 'pascal-case', 'upper-case'], | ||
], | ||
// Dependabot and others exceed body and body line length so just disable it | ||
'body-max-length': [0, 'always', 100], | ||
'body-max-line-length': [0, 'always', 100], | ||
// Allow longer header length | ||
'header-max-length': [2, 'always', 150] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
module.exports = { | ||
readVersion(contents) { | ||
const match = contents.match(/gem.version\s+= '([^']+)'/) | ||
if (!match) { | ||
throw new Error('Could not parse gemspec'); | ||
} | ||
return match[1]; | ||
}, | ||
writeVersion(contents, version) { | ||
return contents | ||
.replace(/(gem.version\s+=) '[^']+'/, `$1 '${version}'`) | ||
.replace(/(gem.add_runtime_dependency 'log-courier',) '= [^']+'/, `$1 '= ${version}'`); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module.exports = { | ||
readVersion(contents) { | ||
const match = contents.match(/LogCourierVersion string = "([^"]+)"/) | ||
if (!match) { | ||
throw new Error('Could not parse version.go'); | ||
} | ||
return match[1]; | ||
}, | ||
writeVersion(contents, version) { | ||
const [major, minor, patch] = version.split('.'); | ||
return contents | ||
.replace(/(LogCourierMajorVersion uint32 =) \d+/, `$1 ${major}`) | ||
.replace(/(LogCourierMinorVersion uint32 =) \d+/, `$1 ${minor}`) | ||
.replace(/(LogCourierPatchVersion uint32 =) \d+/, `$1 ${patch}`) | ||
.replace(/(LogCourierVersion string =) "[^"]+"/, `$1 "${version}"`); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module.exports = { | ||
readVersion(contents) { | ||
const match = contents.match(/VERSION = '([^']+)'/) | ||
if (!match) { | ||
throw new Error('Could not parse version.rb'); | ||
} | ||
return match[1]; | ||
}, | ||
writeVersion(contents, version) { | ||
const [major, minor, patch] = version.split('.'); | ||
return contents | ||
.replace(/(MAJOR_VERSION =) \d+/, `$1 ${major}`) | ||
.replace(/(MINOR_VERSION =) \d+/, `$1 ${minor}`) | ||
.replace(/(PATCH_VERSION =) \d+/, `$1 ${patch}`) | ||
.replace(/(VERSION =) '[^']+'/, `$1 '${version}'`); | ||
} | ||
}; |
Oops, something went wrong.