Commit Graph

159 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 97327c3d28 refactor(linters): add prefer-coerce-array rule (#45492)
* refactor(linters): add prefer-coerce-array rule

Refs #45217

`x ?? []` and `coerceArray(x)` say the same thing, but only the second
one is searchable and consistent. The rule flags a `??` whose default is
a bare `[]` literal; a non-empty default or an asserted `([] as Foo[])`
still passes.

Applying it across `lib/` surfaced three spots the helper cannot cover,
which keep `?? []` with a disable comment or a narrower fix:

- `package-files.ts` destructures a tuple, which `coerceArray()` widens
- `generate.spec.ts` defaults `matchAll()`, an iterator rather than an array
- `mise/upgradeable-tooling.ts` declares a `Record` return, so its
  `?? []` fallback was wrong to begin with and becomes `coerceObject()`

* refactor(platform/github): hoist the GHE version header lookup

`Object.entries(...).find()` returns a tuple, and defaulting it with
`?? []` only to destructure the second element reads as an array
default when it is not one. Name the found entry instead, which drops
the `?? []` rather than routing a tuple through `coerceArray()`.
2026-08-28 09:27:58 +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 d57843c60d refactor(oxlint): enable typescript/no-unnecessary-type-arguments (#44555)
Enable the type-aware typescript/no-unnecessary-type-arguments rule as
error and remove all 44 pre-existing redundant type arguments (type
arguments identical to the type parameter default), e.g.
HttpResponse<string>, ZodError<unknown>,
PackageDependency<Record<string, any>>.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 12:33:42 +00:00
Jamie Tanna da5b7c3a67 chore: use a stable sort for manager extract durations (ms) (#41509)
As per request in #40091, we have cases where folks are using tools to
read or diff the `manager extract durations (ms)`

To improve this, we can make sure to perform a stable sort, by
alphabetically sorting our package manager names.

Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io>
2026-02-26 13:36:13 +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
Jamie Tanna e1ad5c2ddd fix(instrumentation): instrument manager extractions (#39613)
As a means to provide more insight into how long package manager
extractions take when using instrumentation, we can wrap the individual
manager's extractions, as well as the filtering of packageFiles for each
manager.
2025-11-28 19:32:13 +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
Mirko Kruschke cb695e3907 feat(npm): support yarn catalogs via yarn-plugin-catalogs (#37293)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
2025-09-22 14:41:46 +00:00
Sergei Zharinov 476b5ece1c fix: Supersede managers exclusively (#37737) 2025-08-28 04:50:16 +00:00
Sergei Zharinov 585f1d5886 refactor: Reduce loop nesting for processSupersedesManagers (#37733) 2025-08-27 15:43:15 +00:00
Michael Kriese f4e3a9ceea feat(poetry): supersede pep621 (#37458) 2025-08-16 09:01:01 +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
Michael Kriese 4f60a8b7fe test: mock git globally (#34783) 2025-03-13 15:48:02 +00:00
Trim21 6e5731b554 test: migrate from jest to vitest (#34499) 2025-02-26 14:18:38 +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
Fotis Papadogeorgopoulos 0f06866080 feat(managers/npm): support pnpm catalogs (#33376)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
2025-01-28 10:11:55 +00:00
RahulGautamSingh d094afeb82 refactor(manager/custom): reorganize and update utility functions (#33050) 2024-12-12 20:12:59 +00:00
Rhys Arkins 5f1286ff00 fix: massage depName if missing (#28831) 2024-05-04 14:41:41 +00:00
eschleining c9a8a72ac9 feat(config): mergeable repositoryAliases global option (#26848) 2024-01-29 18:06:03 +00:00
RahulGautamSingh 79556f4ecb refactor(enabled-managers): implement custom.<customMgrName> syntax (#24079)
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-11-08 13:13:26 +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
Rhys Arkins bb6bc356dc feat(bun): support multiple lock files (#24594) 2023-09-22 11:31:58 +00:00
Rhys Arkins d036c044c9 feat: initial bun support (#24464)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-09-18 18:10:00 +00:00
RahulGautamSingh 2ffbd41b59 refactor(types): move custom manager types (#24324) 2023-09-13 05:31:48 +00:00
Michael Kriese 84a97a62fa test(perf): improve test speed (#24323) 2023-09-08 11:40:04 +00:00
RahulGautamSingh 0613c24729 feat(managers/custom): introduce customType field (#23919)
Co-authored-by: Anne Stellingwerf <astellin@opentext.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2023-08-22 14:01:03 +00:00
RahulGautamSingh bf2c0693ac refactor(managers): implement custom managers api (#23357)
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
Co-authored-by: Sebastian Poxhofer <secustor@users.noreply.github.com>
2023-08-15 17:12:54 +00:00
Rhys Arkins 36e2b328bb chore: update types reference 2023-08-15 11:31:15 +02:00
RahulGautamSingh 9dc51d03c4 refactor(managers): move regex in custom folder (#23715) 2023-08-06 11:00:47 +00:00
Adam Setch 2159444ee1 refactor: use minimatch util (#23549) 2023-07-26 07:51:10 +00:00
RahulGautamSingh 932012fa20 refactor(test): fix getConfig imports (#22819) 2023-06-16 17:57:34 +00:00
RahulGautamSingh 18c2850f20 refactor(test): use minimal config objects (#22769) 2023-06-15 04:33:56 +00:00
RahulGautamSingh be2a89520b refactor: replace as assertions (#22442) 2023-06-05 19:18:30 +00:00
Rhys Arkins 9276a54069 refactor(scm): use scm for getFileList, checkoutBranch (#22006) 2023-05-07 04:12:15 +00:00
Boris Bera 18ddc2fe74 feat(manager/dockerfile): support file names that are all lowercase (#21877) 2023-05-03 19:05:39 +00:00
renovate[bot] 58aa841d69 build(deps): update dependency minimatch to v9 (#21923)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-05-02 13:00:40 +00:00
Liora Milbaum bcb61d5360 feat(manager/dockerfile): match Containerfile (#20804)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2023-03-10 05:37:14 +00:00
Rhys Arkins a3cc159f7e chore: extract and lookup duration logging (#20816) 2023-03-09 11:24:50 +00:00
Rhys Arkins 2f8aa56fd8 refactor(autoreplace): set depIndex during flatten (#20665) 2023-02-28 10:16:33 +00:00
Rhys Arkins cc33d34ca8 refactor: PackageFile types (#20498)
Co-authored-by: RahulGautamSingh <rahultesnik@gmail.com>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2023-02-20 14:58:49 +00:00
Rhys Arkins 3cef2f2e4f refactor: PackageFile -> PackageFileContent (#20502) 2023-02-19 12:43:48 +00:00
Rhys Arkins cf6be1719e feat(cache): retain fingerprints for all matched managers (#20138) 2023-02-01 09:12:45 +01:00
RahulGautamSingh c7c5c8fb47 refactor: ExtractResult (#20131) 2023-01-31 20:05:23 +01:00
RahulGautamSingh 92abdc9b4d feat(cache): reduce configHash fields for fingerprinting (#18216) 2022-12-16 15:50:35 +00:00