Commit Graph

29 Commits

Author SHA1 Message Date
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 64e6a4c71f refactor(oxlint): enable unicorn/prefer-at (#44556)
Enable the unicorn/prefer-at rule as error in .oxlintrc.json and fix all
43 pre-existing violations (arr[arr.length - 1] -> arr.at(-1)) via oxlint
autofix. Where .at() widened the type to T | undefined, non-null
assertions were added at sites where surrounding logic guarantees the
element exists (length guards, split results), preserving the original
runtime behavior and typing.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 12:57:23 +00:00
Johannes Feichtner 4dbfc7a53c feat(manager/gradle): add support for implicit version catalog accessor syntax (#42746)
* feat(manager/gradle): add support for implicit version catalog accessor syntax

* fix coverage in else branches
2026-04-20 12:58:25 +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
Sergei Zharinov ae49b7af38 chore(deps): switch to @renovatebot/good-enough-parser (#40623)
* chore(deps): switch to @jrnv/good-enough-parser

* chore(deps): switch to @renovatebot/good-enough-parser

* chore(deps): update @renovatebot/good-enough-parser to 1.2.0
2026-01-26 12:44:11 +00:00
Johannes Feichtner abb00a702b feat(gradle): add support for implicit test suite dependencies (#33775) 2025-01-27 07:48:22 +00:00
Johannes Feichtner 6ff935ef0b fix(gradle): remove redundant checks and parser statements (#33526) 2025-01-11 13:16:00 +00:00
Johannes Feichtner 6cf23f2bf1 refactor(gradle): extract redundant functions and remove snapshot (#33430) 2025-01-09 07:22:45 +00:00
Johannes Feichtner 0ff6e98493 feat(gradle): add support for java.toolchain.languageVersion detection in build.gradle(.kts) files (#32461) 2024-11-21 11:16:25 +00:00
Sebastian Poxhofer 3681b2a945 chore: eslint to enforce for typed imports (#30844) 2024-08-19 13:15:27 +00:00
renovate[bot] cbef575a2c chore(deps): update linters to v6.20.0 (#26925)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2024-02-12 09:09:29 +00:00
Johannes Feichtner da8396e384 feat(manager/gradle): add support for micronaut plugin (#26519) 2024-01-06 08:01:31 +00:00
Sergei Zharinov b69416ce17 refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
Johannes Feichtner a57cdfdb85 feat(manager/gradle): add support for Kotlin import directives (#25486) 2023-10-28 21:53:31 +00:00
Sergei Zharinov 53263bbfda feat: Clone objects via wrapper (#22970) 2023-06-27 13:09:59 +00:00
Johannes Feichtner eec46d1880 feat(gradle/manager): add support for Kotlin objects in buildSrc files (#21892) 2023-05-10 19:36:05 +00:00
guicamest 2112ea2646 feat(manager/gradle): Support properties map in gradle kts (#21792) 2023-05-07 15:47:06 +00:00
Jamie Magee a6dfa70c1d chore: migrate to structuredClone (#20885)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
2023-04-27 05:06:22 +00:00
Sergei Zharinov 6bd1277c89 fix(manager/gradle): Filter false positives out of extracted deps (#21753) 2023-04-23 08:33:49 +02:00
Johannes Feichtner 94b42c5123 refactor(gradle/manager): introduce method to resolve variables (#21531) 2023-04-17 06:13:31 +00:00
Johannes Feichtner 8512072d41 feat(manager/gradle): add support for AndroidX Compose plugin (#20796) 2023-03-08 06:31:56 +00:00
Johannes Feichtner f31d62810c feat(manager/gradle): add support for jmh plugin (#20784) 2023-03-07 04:59:12 +00:00
Johannes Feichtner f1e3803d96 refactor(manager/gradle): manage nesting depth separate from tokens (#20763) 2023-03-06 05:37:48 +00:00
Johannes Feichtner bfc38bf732 feat(manager/gradle): replace individual value matchers with placeholder (#19996) 2023-02-03 18:36:00 +00:00
Johannes Feichtner 0eb77da9cf feat(manager/gradle): enable support for concatenated properties (#19659)
Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Sergei Zharinov <zharinov@users.noreply.github.com>
2023-01-05 14:43:52 +01:00
Johannes Feichtner 80d53a1222 feat(manager/gradle): enable property accessors for registry URLs (#19609) 2022-12-29 22:26:02 +01:00
Johannes Feichtner 6beeba6f02 refactor(manager/gradle): group parser directives in separate files (#19465) 2022-12-18 08:25:44 +01:00
Johannes Feichtner 786899eadf feat(manager/gradle): add support for implicit gradle plugins (#19111) 2022-12-09 12:11:09 +00:00
Johannes Feichtner b14336b3af feat(manager/gradle): reimplement parser using tree-based approach (#18663) 2022-11-15 19:23:06 +00:00