67 Commits

Author SHA1 Message Date
Jamie Tanna 8abbd14fe6 fix(config/validation): allow only capturing currentDigest in Custom Managers (#45671)
* fix(config/validation): allow only capturing `currentDigest` in Custom Managers

As reported in #45665, it was previously possible - through a preset
prior to 44.60.1 - to specify a Custom Manager (in this case, with
Regex) that only captured the `currentDigest` for a dependency.

This causes config validation in a repository, but as it appears to be
valid - with `currentValue` defaulting to `latest` - we should make it
possible to use either `currentValue` or `currentDigest`.

* fixup! fix(config/validation): allow only capturing `currentDigest` in Custom Managers
2026-09-04 11:30:15 +00:00
Sebastian Poxhofer 2fc46bdcfa test(manager): replace file snapshots with explicit assertions (#45656)
* test(manager): replace file snapshots with explicit assertions

* test(manager): replace inline snapshots with explicit assertions

* test(manager): assert on relevant sections instead of full bodies

* test(manager): drop assertions implied by full equality

* test(manager): address review feedback

* test(manager): assert depType and versioning in the regex matcher
2026-09-04 06:36:39 +00:00
Sebastian Poxhofer c32e2391a0 refactor(linters): add prefer-coerce-object rule (#45493)
Refs #45216

The object counterpart to `prefer-coerce-array`: `x ?? {}` becomes
`coerceObject(x)`. The rule flags a `??` whose default is a bare `{}`
literal, so a populated default or an asserted `({} as Foo)` still
passes; a `x ?? y ?? {}` chain maps onto `coerceObject(x, y)`.

Every hit across `lib/` converted cleanly, so no disable comments were
needed.
2026-08-28 09:27:59 +00:00
Sebastian Poxhofer e0cec3dc95 refactor(lint): add types-location rule and enable it for lib/modules (#45497)
feat(lint): add `types-location` rule and enable it for `lib/modules`

Reviewers consistently ask for exported types to be moved into a
colocated `types.ts`. Add a `renovate/types-location` oxlint rule that
reports `export interface` / `export type` declarations outside such a
file, and turn it on across `lib/modules`.

Re-exports (`export type { X }`, `export type *`), file-local types, and
values (enums, classes, functions) are left alone. `schema.ts` files and
`schema/` directories are excluded via config, matching how
`zod-schema-location` is configured — inferred types belong next to the
schema they are derived from.

Relocating the 87 existing violations means:

- new `types.ts` files for the modules that had none
- `terragrunt/common.ts` folded into its `types.ts`, as it held nothing
  else
- `RangeBound` in `versioning/gradle/compare.ts` un-exported, since only
  a file-local interface referenced it
- `bazel-module/parser/fragments.ts` split from its inferred types, which
  now live in `parser/types.ts` and infer through a namespace import so
  each schema keeps its merged name
2026-08-27 19:52:09 +00:00
Sebastian Poxhofer e01b50c6ab refactor(linter): oxlint prefer partial typed casts for consts (#45239)
* refactor: flag all typed object literal casts in prefer-partial-in-specs

* refactor: type maven spec httpError helper against got response shape
2026-08-12 08:50:57 +00:00
Jamie Tanna 8108714fc3 docs: validate JSONC and Javascript code blocks (#45063)
* docs: correct `onboardingConfig` example

As we'll be enforcing this as valid Global config in future commits.

Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>

* docs: correct `module.exports` syntax

As we'll be enforcing this as valid Global config in future commits.

Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>

* docs: completely skip `doc-fence-check` on code blocks only used for synatx highlighting

Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>

* docs: skip schema validation on non-config snippets

As we'll be enforcing this as valid Global config in future commits.

Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>

* chore(tools/doc-fence-check): validate JSONC and Javascript code blocks

To further ensure that our documentation is well-formed, we can validate
that JSONC and Javascript code blocks are well-formed syntactically, and
are valid Renovate configuration.

Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>

* chore(tools/doc-fence-check): allow opting out of syntax validation

On top of schema validation wanting to be disabled, we should also
support disabling the syntax validation, in the case that we're using
`json` code blocks for syntax highlighting, but they're not necessarily
well-formed JSON.

Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>

* docs: use `json` syntax highlighting

As `jsonc` doesn't seem to exist in Material for MkDocs.

As it's only for syntax highlighting, we need to opt out of validation.

* tsc

---------

Co-authored-by: Claude Sonnet 5 <jamie.tanna+claude-code@mend.io>
2026-08-04 13:18:08 +00:00
renovate[bot] 196101a6bb chore(deps): update dependency oxlint-tsgolint to v0.25.0 (main) (#44424)
* chore(deps): update dependency oxlint-tsgolint to v0.25.0

| datasource | package         | from   | to     |
| ---------- | --------------- | ------ | ------ |
| npm        | oxlint-tsgolint | 0.23.0 | 0.25.0 |

* chore: fix new no-unnecessary-type-assertion findings

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Sebastian Poxhofer <sebastian.poxhofer@stedi.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 07:04:21 +00:00
Sebastian Poxhofer 58771bb183 refactor(linters): enabled oxlints func-style (#44691)
* refactor(oxlint): enable func-style

Enable the built-in func-style rule as ["warn", "declaration"] so that
named functions are written as function declarations instead of arrow or
function expressions assigned to variables, matching the convention in
docs/development/best-practices.md (Functions section). Inline arrow
callbacks are unaffected; prefer-arrow-callback continues to cover the
callback direction.

Severity is "warn" instead of "error" as a fallback: a repo-wide run
found 196 pre-existing violations (70 in spec files, 126 in production
code), exceeding the 80-violation fix threshold for this change, so no
violations were fixed here. Follow-up work can convert the offenders
(largest clusters: lib/modules/versioning/ruby, lib/util/cache/package,
lib/modules/versioning/maven, lib/modules/versioning/gradle) and then
raise the rule to "error". Note oxlint 1.72 also supports an
allowTypeAnnotation option if typed consts should remain arrows.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* ci(linter): enforce func-style at error

* refactor(func-style): convert const-arrow functions to declarations in with-cache spec and ruby versioning

* refactor(func-style): convert const-arrow functions to declarations in maven/gradle modules

* refactor(func-style): convert const-arrow functions to declarations in remaining versioning modules

* refactor(func-style): convert const-arrow functions to declarations in platform modules

Discriminated-union closures (ensureCommentRemoval byTopic/byContent
helpers in github, gitlab, bitbucket, bitbucket-server) needed the
narrowed field passed explicitly as a parameter, since function
declarations are hoisted and lose the outer if-narrowing that inline
arrow-function closures previously relied on.

* refactor(func-style): convert const-arrow functions to declarations across util/manager/datasource modules

One case (logger/renovate-logger.ts logOnceFn) is kept as an arrow
function with a documented oxlint-disable: it is stored on
this.logger.once[level] and relies on lexically-bound this, which a
hoisted function declaration would not preserve.

* refactor(func-style): convert remaining const-arrow test helpers to declarations

get-updated.spec.ts: hoisted expectPipCompilePackageAndLockFile to
module scope (it only closes over the module-level pipCompile mock)
and added a documented oxlint-disable for vitest/expect-expect on its
caller test, since oxlint's expect-expect check does not trace
assertions through an externally-defined helper function.

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-19 11:14:22 +00:00
Sebastian Poxhofer 00043d193e test(linters): add codeblock linter rule for spec fixtures (#44551)
* ci(linter): add renovate/codeblock-in-spec-fixtures rule

Add a custom oxlint rule that requires the codeBlock (or stripIndent)
template helper from common-tags for multi-line string fixtures in spec
files (enabled for **/*.spec.ts and test/** only).

The rule only flags shapes whose value can round-trip through the
common-tags helpers unchanged, since both codeBlock and stripIndent trim
the end result and strip the shortest line indentation:

- only literals spanning multiple source lines are flagged (escaped \n
  one-liners are left alone: tagging them is not value-preserving in
  general and gains nothing)
- values with leading/trailing whitespace (e.g. fixtures ending in a
  newline) are not flagged
- tagged templates, describe/it titles, and inline snapshot arguments
  are skipped

All 55 pre-existing violations (22 files) were fixed with a one-off
codemod that re-emits each fixture indented to the statement depth and
verifies value preservation by evaluating codeBlock on the rewritten
template (substitutions kept as opaque placeholders). One site
(pip_requirements/artifacts.spec.ts) mixes line continuations with
escaped newlines and was tagged verbatim instead of re-indented.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* ci(linter): address review findings

Make getSimpleRequirementsFile in pip-compile/extract.spec.ts
value-preserving again: tagging the whole template with codeBlock
trimmed the trailing blank line when deps is empty (the headerOnly.txt
case), silently changing the fixture from ending in '#\n\n' to '#'.
Tag only the static header and append the deps section via a
single-line template, which reproduces the original string exactly
for both empty and non-empty deps (verified by executing old vs new
in node).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 13:00:02 +00:00
RahulGautamSingh 198a4a7bb7 fix(custom/jsonata): support autoReplaceStringTemplate (#43535)
* fix(custom/jsonata): support autoReplaceStringTemplate

* apply suggestions

* fix types
2026-07-10 06:29:59 +00:00
Michael Kriese d8e82a2412 fix(manager/custom/jsonata): handle evaluation errors (#44340) 2026-07-02 10:37:04 +00:00
Sebastian Poxhofer 15f4bd8eff chore: migrate from zod/v3 to zod/v4 (#43691)
* chore: migrate from zod/v3 to zod/v4

This commit contains the logic changes

* chore: migrate imports from zod/v3 to zod/v4

This contains import updates and adds explicit record keys as zod/v4 requires these now

* ci: enforce usage of zod/v4
2026-05-30 16:01:58 +00:00
Sebastian Poxhofer 03baf6ee4a test(noNewURL): add new rule enforcing parseUrl() from 'lib/util/url.ts' (#43247)
* test(noNewURL): add new rule enforcing parseUrl() from 'lib/util/url.ts'

* replace newURL with parseUrl

* remove non-null assertions marks if appropiate

* test: add additional tests

* test: add additional tests and ignore where it makes sense

* implement suggestions

* test: further improve coverage

* apply suggestion
2026-05-13 16:23:10 +00:00
RahulGautamSingh ff27ebee2b docs: use unicode arrow (→) instead of ASCII (->) (#42896)
* chore(docs): use unicode arrow (→) instead of ASCII (->)

* more changes
2026-04-27 07:11:16 +00:00
Jamie Tanna e0ce9dabd6 docs: prefix child options with their parent (#41828)
This also makes sure that our URL fragments should be more consistent
over the years, as duplicate names (across parent and child options)
cannot clash.

This also corrects links from the code to include the new fragment.

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-03-12 10:56:52 +00:00
renovate[bot] 645a28c77c build(deps): update dependency prettier to v3.8.1 (main) (#39779)
* build(deps): update dependency prettier to v3.8.1

| datasource | package  | from  | to    |
| ---------- | -------- | ----- | ----- |
| npm        | prettier | 3.6.2 | 3.8.1 |

* fixup prettier

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: secustor <sebastian@poxhofer.at>
2026-02-18 08:41:34 +00:00
renovate[bot] 4a2578d18d build(deps): update dependency zod to v4 (main) (#41225)
* build(deps): update dependency zod to v4

| datasource | package | from    | to    |
| ---------- | ------- | ------- | ----- |
| npm        | zod     | 3.25.76 | 4.3.6 |

* fix: zod migration

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2026-02-18 07:37:50 +00:00
Sergei Zharinov 9d857c1f68 refactor(lint): Organize imports with biome (#40966) 2026-02-06 13:40:01 +00:00
Sergei Zharinov 930cf6633c refactor: Rewrite imports with .ts extensions (#40700)
fix: Additional vi.mock path corrections and prettier formatting
2026-01-26 22:48:17 +00:00
RahulGautamSingh 18bd32166b chore: replace URL.resolve (#40702)
replace URL.resolve
2026-01-26 18:59:54 +00:00
RahulGautamSingh 67d4e34381 feat(manager/regex): extract depName from file path (#39204)
* feat: extract depName from file path

* Apply Suggestions

* refactor: precompute paths

* use upath method

* Applu Suggestions

* Update lib/modules/manager/custom/regex/types.ts

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>

* Apply suggestions from code review

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>

---------

Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-12-03 18:29:29 +00:00
RahulGautamSingh 76f911041a refactor: use named exports (#39196)
* use named exports

* fix test

* add missing imnport

* fix prettier
2025-11-10 12:00:35 +00:00
renovate[bot] b4ed9e65d9 chore(deps): update dependency @vitest/eslint-plugin to v1.3.23 (main) (#38702)
* chore(deps): update dependency @vitest/eslint-plugin to v1.3.23

| datasource | package               | from   | to     |
| ---------- | --------------------- | ------ | ------ |
| npm        | @vitest/eslint-plugin | 1.3.16 | 1.3.23 |

* remove now unnecessary exceptions

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: secustor <sebastian@poxhofer.at>
2025-10-31 07:50:48 +00:00
renovate[bot] 1280fe4dc7 chore(deps): update dependency @vitest/eslint-plugin to v1.3.16 (main) (#38502)
* chore(deps): update dependency @vitest/eslint-plugin to v1.3.16

| datasource | package               | from   | to     |
| ---------- | --------------------- | ------ | ------ |
| npm        | @vitest/eslint-plugin | 1.3.13 | 1.3.16 |

* fix linting errors

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: secustor <sebastian@poxhofer.at>
2025-10-13 09:24:15 +00:00
Anne Stellingwerf 9fae0192a1 docs: introduce JSON schema validation and migration checks (#38145)
* docs: introduce JSON schema validation and migration checks

* refactor(tools): enhance code clarity with additional typings, comments, and optional chaining

* ci(workflows): add build steps to lint and type-check jobs

* Update tools/check-fenced-code.mjs

Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>

* Partial revert

* docs(jsonata): fix wording in code block title in readme

* ci(workflows): remove redundant build steps from workflows

* ci(workflows): remove redundant build steps from workflows

* refactor(tools): simplify error reporting

* Incorporate feedback

* Incorporate feedback

* Incorporate feedback

---------

Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>
2025-10-07 10:54:48 +00:00
Andreas Lindhé ce790bdc26 docs(jsonata): add required field fileFormat and fix typo (#38419)
* docs(jsonata): Replace ' with " in JSON config

* docs(jsonata): Mention that `fileFormat` is a required field

When I validated my config, I was informed that `fileFormat` is required
for the jsonata manager.
This change updates the docs accordingly.

* docs(jsonata): Fix prettier lint errors

* docs(jsonata): Attempt to fix docs link…

* docs(jsonata): add missing parent directory to link

* fixup! docs(jsonata): add missing parent directory to link

* docs(jsonata): directory links are from the built sources

---------

Co-authored-by: Jamie Tanna <github@jamietanna.co.uk>
Co-authored-by: Jamie Tanna <jamie.tanna@mend.io>
2025-10-07 10:21:07 +00:00
Adam Setch 86f6a304cd docs: jsonata file format (#38042)
Signed-off-by: Adam Setch <adam.setch@outlook.com>
2025-09-16 17:28:48 +00:00
Jan-Philipp Litza 009ff4dd5b fix(jsonata): Eval later queries despite non-match (#37186)
Signed-off-by: Jan-Philipp Litza <janphilipp@litza.de>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2025-08-14 16:42:27 +00:00
Michael Kriese 3211d56e21 refactor(zod): rename schema to match our best practices guide (#37499) 2025-08-14 10:35:03 +00:00
Michael Kriese 639d259626 refactor: unify more types (#37148) 2025-07-25 07:08:35 +00:00
khung 5df51f7562 docs: Provide an example of how the JSONata manager parses YAML (#36504) 2025-06-13 14:39:29 +00:00
Moritz Gnisia 72f916d0d2 docs: Adjust regex to match case (#36485)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2025-06-13 04:20:03 +00:00
Pavel Kutáč 83162b1991 docs: add note about enabledManagers within customManagers (#35774) 2025-05-07 09:14:40 +00:00
RahulGautamSingh bc7d0595d0 feat(config): managerFilePatterns (#34615)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2025-05-04 08:30:24 +00:00
Michael Kriese 19c115c813 test: cleanup (#34785) 2025-03-13 17:52:09 +00:00
Rhys Arkins b1e19a999a chore(manager/custom): log when no dependencies for custom regex manager (#34710) 2025-03-09 11:38:05 +00:00
Risu 83ec919090 docs(managers): clarify multi-line mode is not supported in regex custom manager (#34571)
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2025-03-05 17:45:41 +00:00
Michael Kriese 997c23502e test: migrate to vitest (#34475)
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2025-02-26 09:35:54 +00:00
RahulGautamSingh 1cb61dc44c feat(manager/jsonata): add toml support (#34380)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2025-02-24 06:51:36 +00:00
Markus Maga 27117b177d docs(jsonata): fix code block title for jsonata example (#34055) 2025-02-06 05:56:14 +00:00
RahulGautamSingh 77a5c15daa fix(manager/jsonata): populate extract result with manager config fields (#33992) 2025-02-02 15:16:42 +00:00
Michael Kriese e63ff23795 feat(jsonata): support yaml (#33972) 2025-01-31 16:23:32 +00:00
RahulGautamSingh fc8b8f9b61 feat(managers/custom): generic manager for json files (#32784)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2025-01-30 11:52:39 +00:00
RahulGautamSingh d094afeb82 refactor(manager/custom): reorganize and update utility functions (#33050) 2024-12-12 20:12:59 +00:00
Sergei Zharinov 90088cc03e refactor: Rename manager result type to MaybePromise (#32977) 2024-12-09 06:38:20 +00:00
Ed Harrod 894250d392 chore(manager/gomod): Update go version to 1.23.3 in tests/examples (#32514)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-11-13 15:45:18 +00:00
HonkingGoose d125c9947b docs(regex): rewrite (#32138) 2024-10-31 08:59:15 +00:00
Sergei Zharinov 321e304ca1 test(regex-manager): Separate arrange/act/assert with spaces (#30972) 2024-08-22 20:05:30 +00:00
Oluf Lorenzen e70f107acb docs(manager/custom): hint about multiple replacements (#30680) 2024-08-15 08:34:16 +00:00
renovate[bot] eb8c08079e chore(deps): update typescript-eslint monorepo to v8 (major) (#30750)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-08-14 10:33:02 +00:00