Commit Graph

28 Commits

Author SHA1 Message Date
Sebastian Poxhofer 05e1271376 test: use expect().resolves instead of awaiting inside expect (#45672)
Enables the vitest/prefer-expect-resolves oxlint rule and applies its
autofix across the spec suite.
2026-09-04 10:40:46 +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
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 19c115c813 test: cleanup (#34785) 2025-03-13 17:52:09 +00:00
Sergei Zharinov 165e717edd refactor(rubygems): Rename RubyGemsDatasource to RubygemsDatasource (#30882) 2024-08-19 12:44:23 +00:00
Sergei Zharinov b69416ce17 refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
Michael Kriese 84a97a62fa test(perf): improve test speed (#24323) 2023-09-08 11:40:04 +00:00
Sergei Zharinov 992b336a89 fix(rubygems): Use cascade of endpoints for unknown servers (#23523) 2023-07-25 15:43:14 +00:00
Sergei Zharinov 6451c3af73 refactor(rubygems): Use Result class (#23522) 2023-07-24 18:40:21 +00:00
Sergei Zharinov 285bed3e43 test(rubygems): Simplify tests (#23521) 2023-07-23 13:41:17 +00:00
Sergei Zharinov 3559cb3980 refactor(rubygems): Unify fetching via v1 API (#23517) 2023-07-23 13:14:49 +00:00
Sergei Zharinov 728a8a1c68 feat(rubygems): Enable metadata fetching (#22860) 2023-06-18 20:09:07 +00:00
Sergei Zharinov d8c7a14ef9 refactor(rubygems): Remove unnecessary package name guard (#22809) 2023-06-16 07:04:24 +00:00
Sergei Zharinov 0be6dba296 refactor(rubygems): Versions endpoint cache (#22792) 2023-06-15 15:17:49 +00:00
Sergei Zharinov b90cc32c12 feat(rubygems): Incremental sync for version lists (#22564) 2023-06-07 14:06:09 +00:00
Sergei Zharinov cd5abc87b8 refactor(rubygems): Use schema for fallback API (#21933) 2023-05-17 08:12:20 +00:00
Sergei Zharinov 79313fa68b test(rubygems): Inline params for better readability (#22017) 2023-05-07 21:17:14 +00:00
Sergei Zharinov 708f5e8e52 fix(rubygems): Use module-local memory cache (#21884) 2023-04-29 07:45:48 +00:00
Sergei Zharinov d166bc01e6 fix(rubygems): Use memcache instead of module-local const (#21874) 2023-04-28 17:05:46 +00:00
Rhys Arkins b17bcf2789 refactor(datasource): use packageName and not depName for datasource lookups (#20474) 2023-03-10 09:34:40 +01:00
Jonathan Narwold 03b5982c67 feat(rubygems): support a fallback to /versions endpoint (#16312) 2022-12-16 11:22:49 +00:00
IKEDA Sho 9a413e5f2e test(datasource): remove unnecessary optional chaining in tests (#16572) 2022-07-14 05:28:51 +00:00
Michael Kriese 0838ca209c refactor: strict datasource tests (#16150) 2022-06-20 13:15:02 +02:00
Michael Kriese 64f5bd5f03 test: enforce lint style rules (#15085) 2022-04-12 14:49:49 +00:00
Michael Kriese 443bef5c52 test: cleanup snapshot tests (#15082) 2022-04-12 15:09:19 +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
Rhys Arkins dca3418bbd refactor: lib/modules (#14488)
Moves datasource, manager, platform and versioning code from lib/ into new lib/modules/

BREAKING CHANGE: External tools must update paths to datasource, manager, platform and versioning
2022-03-04 09:04:02 +01:00