-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove checkbox hints + checkbox formatting for bitbucket via re…
…adOnlyIssueBody() transformer (#3765)
- Loading branch information
Showing
4 changed files
with
55 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,12 @@ | ||
function readOnlyIssueBody(body) { | ||
return body | ||
.replace(' only once you click their checkbox below', '') | ||
.replace(' unless you click a checkbox below', '') | ||
.replace(' To discard all commits and start over, check the box below.', '') | ||
.replace(/ Click (?:on |)a checkbox.*\./g, '') | ||
.replace(/\[ ] <!-- \w*-branch.*-->/g, ''); | ||
} | ||
|
||
module.exports = { | ||
readOnlyIssueBody, | ||
}; |
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,11 @@ | ||
## Edited/Blocked | ||
|
||
These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, check the box below. | ||
|
||
- [ ] <!-- rebase-branch=renovate/docker-renovate-renovate-16.x -->[Update renovate/renovate Docker tag to v16.13.8](../pull/2) | ||
|
||
## Closed/Ignored | ||
|
||
These updates were closed unmerged and will not be recreated unless you click a checkbox below. | ||
|
||
- [ ] <!-- recreate-branch=renovate/docker-renovate-renovate-16.10.8 -->[Update renovate/renovate:16.10.8 Docker digest to 6f9a209](../pull/1) |
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,27 @@ | ||
const fs = require('fs'); | ||
const { | ||
readOnlyIssueBody, | ||
} = require('../../../lib/platform/utils/read-only-issue-body'); | ||
|
||
const issueBody = fs.readFileSync( | ||
'test/platform/utils/_fixtures/issue-body.txt', | ||
'utf8' | ||
); | ||
|
||
describe('platform/utils/read-only-issue-body', () => { | ||
describe('.readOnlyIssueBody', () => { | ||
it('removes all checkbox formatting', () => { | ||
expect(readOnlyIssueBody(issueBody)).toEqual( | ||
expect.not.stringContaining('[ ] <!--') | ||
); | ||
}); | ||
|
||
it('removes all checkbox-related instructions', () => { | ||
expect(readOnlyIssueBody(issueBody)).toEqual( | ||
expect.not.stringMatching( | ||
/click (?:(?:on |)a|their) checkbox|check the box below/gi | ||
) | ||
); | ||
}); | ||
}); | ||
}); |