Skip to content

Commit 6f93cf1

Browse files
committed
🩹 fix-simple(Renovate): add a custom regex manager for pre-commit hooks in Jinja template
1 parent 96a22c4 commit 6f93cf1

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

‎.renovaterc.json

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,22 @@
2121
"matchStrings": [
2222
"- \\*\\*(?<depName>Copier|copier-templates-extensions)\\*\\* \u2265 (?<currentValue>.*?)\\s"
2323
]
24+
},
25+
{
26+
"description": "Update pre-commit hook revs in Jinja template",
27+
"customType": "regex",
28+
"datasourceTemplate": "github-tags",
29+
"depNameTemplate": "{{{ depName }}}",
30+
"extractVersionTemplate": "{{currentValue}}",
31+
"autoReplaceStringTemplate": "- repo: https://github.com/{{{depName}}}\n rev: {{{newVersion}}}",
32+
"matchStrings": [
33+
"(?ms)^\\s*-\\s*repo:\\s*https?://github\\.com/(?<depName>[^/\\s]+/[^/\\s]+)\\b.*?\\n\\s*rev:\\s*[\"']?(?<currentValue>v?\\d+\\.\\d+\\.\\d+)[\"']?"
34+
],
35+
"managerFilePatterns": [
36+
"/^template/\\.pre-commit-config\\.ya?ml(?:\\.jinja)?$/"
37+
]
2438
}
2539
],
26-
"pre-commit": {
27-
"managerFilePatterns": [
28-
"/(^|/)template/\\.pre-commit-config\\.ya?ml(?:\\.jinja)?$/"
29-
]
30-
},
3140
"github-actions": {
3241
"managerFilePatterns": [
3342
"/^template/.+\\.github.+/actions/.*\\.ya?ml(?:\\.jinja)?$/",

0 commit comments

Comments
 (0)