Commit Graph

19 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
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 3b3958ed3a fix(gitea,forgejo): dedupe base64 decode (#37136) 2025-07-23 15:39:03 +00:00
RahulGautamSingh 02a6deaa7e feat(gitea): find prs from other authors (#35065) 2025-03-31 10:51:33 +00:00
Sergei Zharinov 9b4e515024 refactor(http): Separate getJson and getJsonUnchecked (#33651) 2025-01-17 14:18:00 +00:00
Michael Kriese bddef47b5a fix(gitea): sort commit status by id (#33622) 2025-01-15 09:13:02 +00:00
Sebastian Poxhofer 3681b2a945 chore: eslint to enforce for typed imports (#30844) 2024-08-19 13:15:27 +00:00
Ronald van Butselaar 0dfea671b3 feat(platform/gitea): autodiscover repos by namespace (#26821)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-03-19 19:54:24 +00:00
Sergei Zharinov de68769fc2 feat(gitea): Add PR cache (#26451)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2024-01-15 17:32:44 +00:00
Sergei Zharinov b69416ce17 refactor(prettier): Force trailing commas (#25631) 2023-11-07 15:50:29 +00:00
RahulGautamSingh 8e4b5231f8 refactor: convert enums to unions (#18900) 2022-11-20 07:34:23 +00:00
RahulGautamSingh af3b2038f8 refactor: replace enums with union/object (#18903) 2022-11-14 20:55:38 +02:00
Michael Kriese ababf34c7e refactor(gitea): cleanup types (#16968) 2022-08-04 12:00:48 +00:00
Michael Kriese a251fc494d feat(platform/gitea): support native automerge (#16885)
* feat(platform/gitea): support native automerge

* Update lib/modules/platform/gitea/index.md

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update lib/modules/platform/gitea/index.ts

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* Update lib/modules/platform/gitea/index.spec.ts

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2022-08-02 12:29:08 +02:00
Dominic Seitz 953ef18e87 feat(gitea): Support gitUrl (#14947)
* feat: Support gitUrl on gitea platform

* refactor: use query token instead of auth header

* refactor: debug message style

* refactor: use url property query

* refactor: use basic http auth for gitea

* test: add gitea tests for gitUrl property

* refactor: capitalising abbreviations

Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>

* refactor: move getRepoUrl to utils

* fix: add missing property ssh_url to fix linting

* fix: utils strict mode issues

* Merge branch 'main' into main

* refactor: use endpoint without api path slicing

* refactor: use different null check

* refactor: make urls optional

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

* test: prettier fix

* test: update test

* refactor: throw error if clone_url is missing

* test: refactor empty clone_url test

* refactor: change empty clone_url logic

* refactor: change imports

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

* test: add token tests

* refactor: replace deprecated url module

* refactor: add null checks

* test: add tests for null checks

* test: use host rule implementation instead of mock

* refactor: remove explicit typing

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

* test: update mocking

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

* test: change dynamic imports

* Update lib/modules/platform/gitea/utils.ts

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>
2022-06-09 13:48:40 +00:00
Dominic Seitz 292f144590 refactor(gitea): use env variable endpoint without api path appendix (#15055)
* refactor: use gitea env variable endpoint without api path appendix

* refactor: use regex for api path trimming

* refacotr: move api path constant to gitea-helper

* refactor: consider end of string for api path trimming

* refactor: use baseUrl in gitea helper tests

* test: use toEqual instead of snapshot test

* refactor: update gitea default endpoint

* test: update gitea base url

* test: update init platform test

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

* test: fix linting

Co-authored-by: Rhys Arkins <rhys@arkins.net>
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
2022-05-24 18:32:45 +00: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 e24bf474ef refactor(platform): more strict null checks (#15247) 2022-04-22 14:13:14 +00: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