renovate/lib/modules/manager/bazel-module/parser/module.ts

25 lines
635 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',
];
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(),
}),
);