0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-01-13 06:38:35 +00:00
renovatebot_renovate/lib/modules/manager/bazel-module/parser/module.ts

25 lines
655 B
TypeScript

import { query as q } from 'good-enough-parser';
import { regEx } from '../../../../util/regex';
import type { Ctx } from '../context';
import { kvParams } from './common';
const supportedRules = [
'archive_override',
'bazel_dep',
'git_override',
'local_path_override',
'single_version_override',
'git_repository',
];
const supportedRulesRegex = regEx(`^${supportedRules.join('|')}$`);
export const moduleRules = q
.sym<Ctx>(supportedRulesRegex, (ctx, token) => ctx.startRule(token.value))
.join(
q.tree({
type: 'wrapped-tree',
maxDepth: 1,
search: kvParams,
postHandler: (ctx) => ctx.endRule(),
}),
);