Commit Graph

103 Commits

Author SHA1 Message Date
Sebastian Poxhofer df8c4051ff test(core): replace file snapshots with explicit assertions (#45660)
* test(core): replace file snapshots with explicit assertions

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

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

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

* test(core): address review feedback

* test(core): use resolves instead of awaiting inside expect
2026-09-04 10:28:55 +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
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 4add67e86e test: add linter for as any in test files (#44658)
* ci(linter): add prefer-partial-in-specs oxlint rule

Flags object literals cast to `any` (`{...} as any`) in spec/test files and steers toward `partial<T>()` from `test/util`. Enabled at error in the spec-files override so CI blocks new occurrences.

Closes #44646

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* test: drop unnecessary object-literal `as any` casts

The casts masked values already assignable to the expected type (migration configs accepted as Record<string, unknown>, all-optional param types, etc.); removing them restores real type checking.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* test: replace object-literal `as any` casts with partial<T>()

Uses partial<T>() from test/util so incomplete mock/config objects keep proper typing. Azure API mocks switch to mockResolvedValue(partial<T>()) and their inner method mocks to mockResolvedValue(), matching the sibling-file idiom.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* test: suppress prefer-partial-in-specs for intentionally-invalid inputs

Some tests deliberately pass malformed or legacy data to exercise validation/error paths, where no real type fits; keep the cast with a reasoned oxlint-disable-next-line.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 10:47:30 +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
Michael Kriese c641239c19 fix: use stricter types for renovate config (#39594)
* fix: use stricter types for renovate config

* fix: revert changes

* Apply suggestions from code review
2025-11-28 13:16:27 +00:00
Michael Kriese 050ac8d23b chore: better code coverage (#39518) 2025-11-25 15:01:54 +00:00
Jamie Tanna abb65969d8 feat(presets): rename npm:unpublishSafe to security:minimumReleaseAgeNpm (#38240)
chore(presets): rename `npm:unpublishSafe` to `security:minimumReleaseAgeNpm`

As noted in #37952, we've seen a significant increase in recent years on
a number of package ecosystems being targeted with supply chain security
attacks.

We're looking to introduce a default for `minimumReleaseAge` in the
`best-practices` config preset, which will use the `npm:unpublishSafe`.

However, we'd first like to rename `npm:unpublishSafe` to
`security:minimumReleaseAgeNpm` to fit within the new proposed naming
scheme.

This introduces a config migration to make sure that we can provide
folks a non-breaking path for the new preset name.
2025-10-01 08:11:29 +00:00
Dave a3616a496a feat: add option skipArtifactsUpdate (#35993)
Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
2025-08-11 09:13:56 +00:00
RahulGautamSingh 3691ff90b2 feat(config): baseBranchPatterns (#35579) 2025-07-14 19:05:27 +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 997c23502e test: migrate to vitest (#34475)
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2025-02-26 09:35:54 +00:00
Michael Kriese 4da584a9a2 fix(package-rules): wrong prefix match glob (#30394) 2024-07-26 08:31:23 +00:00
Rhys Arkins 879f7cc212 feat(packageRules): migrate matchers and excludes (#28602)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-07-25 15:28:16 +02:00
Norbert Szulc 2df7ef51aa feat(manager/pip-compile): Change fileMatch behaviour to target pip-compile output files (#26858)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-02-13 13:53:23 +00:00
Sergei Zharinov b69416ce17 refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
RahulGautamSingh 6f9d37a6c0 feat(migrate): regexManagers -> customManagers (#24451)
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2023-09-24 08:55:56 +00:00
RahulGautamSingh 8aeb64e9f8 fix: improve branch coverage (#24282)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2023-09-08 10:56:56 +00:00
Rhys Arkins 36e2b328bb chore: update types reference 2023-08-15 11:31:15 +02:00
Rhys Arkins 7b82e8d9ef fix(config): migrate language objects (#23157)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-07-05 07:43:08 +00:00
Sebastian Poxhofer 19259a0383 feat!: categories (#16534)
Closes #13953

Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

BREAKING CHANGE: languages are now called categories instead
2023-07-04 19:21:52 +02:00
Rhys Arkins e3d5f7df92 feat!: merge matchPaths and matchFiles into matchFileNames (#22406)
Closes #22395

BREAKING CHANGE: matchPaths and matchFiles are now combined into matchFileNames, supporting exact match and glob-only
2023-07-04 19:21:52 +02:00
RahulGautamSingh 0d85cead02 fix(migration): throw error for invalid hostRules (#20540) 2023-05-22 07:49:26 +00:00
RahulGautamSingh 9a1285d2d2 fix: use matchSourceUrl to match monorepo packages (#18973) 2022-11-20 09:50:27 +00:00
RahulGautamSingh c56588eaba refactor: convert PlatformmId to union (#18458) 2022-11-01 14:46:09 +00:00
Michael Kriese 0316a5e62d test: use jest v29 (#17151) 2022-08-16 14:22:29 +02:00
Michael Kriese 49d851e5fd refactor: tighten typescript types (#15965) 2022-06-09 12:17:05 +00:00
Sean Fausett 5043379847 fix(dockerfile): loosen default dockerfile manager filematch (#15583) 2022-05-15 06:00:45 +02:00
Michael Kriese 982cefff2b refactor(config): strict null checks (#15291)
* refactor(config): strict null checks

* chore: fix test
2022-04-24 22:48:54 +00:00
Michael Kriese 64f5bd5f03 test: enforce lint style rules (#15085) 2022-04-12 14:49:49 +00:00
MaronHatoum 3e312fd641 feat: refactor dry-run option (#14849)
* feat : added dryRun new behavior + added more migration

* feat : revert extra space

* feat : revert extra code

* feat : added unit tests

* feat : added unit tests

* feat : removed extra tests + removed unnecessary condition

* feat: changes after CR

* feat: added dry run migration cli and env + unit tests

* Update lib/workers/global/config/parse/cli.ts

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

* feat: migration changes + added logs + added unit test

* feat: removed log msgs + change unit test

* feat: update

* feat: update

* Update lib/workers/global/config/parse/cli.ts

Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2022-04-11 20:29:02 +00:00
Maksim 5c03670736 feat(migrations): deprecate parentKey param (#14886)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2022-04-04 05:15:11 +00:00
Maksim ab8e1c634e refactor(migrations): packageRules (#14625) 2022-03-21 04:54:49 +00:00
Rhys Arkins 8bd77f747b feat(gradle): remove deepExtract (#14497)
Removes Gradle `deepExtract` option

BREAKING CHANGE: Option `deepExtract` is now removed and will be ignored
2022-03-04 09:04:02 +01:00
Rhys Arkins 143c9a6751 refactor: rename lookupName -> packageName (#14494)
Renames `lookupName` to be `packageName`.

BREAKING CHANGE: Use `packageName` instead of `lookupName` if interacting with Renovate datasources directly.
2022-03-04 09:04:02 +01:00
Maksim da3772ab18 refactor(migrations): host rules (#13874) 2022-02-13 20:07:09 +00:00
Maksim 38a6119154 feat(migrations): composerIgnorePlatformReqs (#13759) 2022-01-23 22:00:02 +01:00
Maksim 574196a384 feat(migrations): split (#13499) 2022-01-13 08:50:20 +00:00
Maksim 06d8c27043 refactor: global config (#12743)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2021-11-23 21:10:45 +01:00
Michael Kriese 7afc2b75d5 test: fix lint (#12551) 2021-11-08 13:16:58 +01:00
Oleg Krivtsov 29dde2f694 test: improve test readability with expect-more-jest (#12329) 2021-10-27 07:24:36 +02:00
Oleg Krivtsov c7f74e3f91 feat(config): migrate yarn -> npm in enabledManagers (#11965) 2021-10-20 14:56:28 +00:00
Sergei Zharinov 6f649eb661 feat(platform): Use uniform platformAutomerge option (#12069)
Existing `azureAutoComplete` and `gitLabAutomerge` options are now unified/renamed to `platformAutomerge`, and also defaulting to `true`.

BREAKING CHANGE: Azure autocomplete will now only be enabled when `automerge` is also enabled (to align with how GitLab automerge already worked). If you were using `azureAutoComplete` before without explicitly enabling Renovate `automerge` field then you will now need to do so. Platform automerge is now the default behavior whenever automerge is enabled.
2021-10-11 06:36:07 +00:00
Maksim 1f86b71fd5 refactor: constants (#11690) 2021-10-06 07:43:32 +02:00
Rhys Arkins e108537964 fix(config): migrate empty array check (#11713) 2021-09-13 15:27:01 +02:00
Michael Kriese 11aa3baf2e test: use codeql compatible token / passwords (#11297) 2021-09-09 16:17:05 +02:00
Bob van de Vijver 3505508c9c feat: Add fully configurable composer ignore platform requirement configuration (#11138)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2021-08-23 18:13:30 +00:00
Sergei Zharinov 5f4b9f9a3a test: Fix test descriptions and enforce it via new linting rule (#11285) 2021-08-18 05:46:56 +00:00