Commit Graph

17 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 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 7a50358949 docs: don't include announcement bar in release notes' attachment (#44031)
chore: don't include announcement bar in release notes' attachment

When building the docs site in CI on `main` (or a release branch), we
currently package up the docs site into the GitHub Release.

However, this includes the "announcement bar", which can include stale
info.

In the case where a user is looking to add a mirror for their Renovate
CLI docs[0], this means they now see an announcement bar which includes
unhelpful - and possibly outdated - information.

As noted in #44030, we can improve this to:

- not include the announcement bar when preparing the attachment for the
  release
- include the announcement bar only when we're updating the docs site

To do this, we need to:

- add a new `--no-announcement` flag (which ensures the default is "do
  add the announcement")
- log when we're not using announcements
- detect the environment variable when building the mkdocs site locally

This means we'll always be rebuilding the docs site (to inject the
announcement bar) which is ~16s as of a recent run.

[0]: https://www.jvt.me/posts/2024/11/19/renovate-private-docs/

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-06-18 08:40:15 +00:00
Felipe Santos 1cc57d4152 docs: switch from pdm to uv for docs dependencies (#43917)
* build(docs): switch from pdm to uv for docs dependencies

* Add pdm back to gitignore

* Remove UV_VERSION

* Restore missing uv sync and set --locked
2026-06-11 05:13:21 +00:00
Jamie Tanna 0190e1c021 chore(tools/mkdocs): support live reload when modifying docs (#43516)
As noted in #40757, when using `tools/mkdocs.ts serve`, any changes to
source files require a full restart of the command, which can be
awkward.

We can add a live reload by watching for file changes in `docs/` and
retriggering the `mkdocs` process.

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-05-22 07:41:49 +00:00
Jamie Tanna f31aec34fe chore(tools): handle additional errors (#42205)
chore(tools): handle additional error

In the case that `pdm` can't be executed, for instance if it's only
installed in a Virtualenv that's not currently active, this previously
would silently pass, even though the command had failed.

We can now make it more resilient by warning/erroring in the cases that:

- there is a timeout
- the process was killed
- the process failed to execute

Originally raised as #40987, which was closed due to the migration to
`execa` and errors being flagged as an `unhandledRejection`.

However, after b35d7c9cad, we would no
longer reject, leading to an incomplete error handling case.
2026-03-27 21:52:16 +00:00
Jamie Tanna 6432d2154a chore: correctly initialise logger for tools/ (#41842)
As part of changes in e438887dfb, we'd
missed the fact that `tools/` would need to have the logger initialized
too.

Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
2026-03-12 10:02:01 +00:00
Michael Kriese b35d7c9cad chore(tools): use async execa (#41712)
* chore(tools): use async execa

* chore: fix lint errors
2026-03-10 16:55:44 +00:00
Jamie Tanna 1778e0424a refactor(tools): migrate to execa (#41062)
For consistency, we should use `execa` for all of our command execution.

Co-authored-by: Claude Sonnet 4.5 <jamie.tanna+github-copilot@mend.io>
2026-02-16 18:07:05 +00:00
Jamie Tanna 7e073d7b8a chore(tools/mkdocs): ensure RENOVATE_VERSION is passed to mkdocs (#40988)
* chore(tools/mkdocs): add `--version` flag

As part of future changes, we'll need to specify the version used as
part of the build, to get the documentation noting the current Renovate
version.

* chore(tools/mkdocs): ensure `RENOVATE_VERSION` is passed to `mkdocs`

As part of e621870dc4, we add the Renovate
version into the footer based on the environment variable.

When we set the `--version` flag for the `generateDocs()` call, we
should also make sure that `mkdocs` is called with `RENOVATE_VERSION`.
2026-02-10 13:24:34 +00:00
Jamie Tanna f71db58fd5 chore(tools/mkdocs): add --version flag (#40986)
As part of future changes, we'll need to specify the version used as
part of the build, to get the documentation noting the current Renovate
version.
2026-02-09 09:27:24 +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 5c462775db ci: re-enable strict docs builds (#39617)
This reverts commit 41335fc486.
2025-11-28 16:59:19 +00:00
Rhys Arkins 41335fc486 chore: disable strict mkdocs (#34827) 2025-03-15 12:09:27 +00:00
Sebastian Poxhofer 3681b2a945 chore: eslint to enforce for typed imports (#30844) 2024-08-19 13:15:27 +00:00
Michael Kriese d666cf1edf docs: improve generation (#30776) 2024-08-14 17:44:52 +00:00
Michael Kriese d90de484b1 docs: validate with mkdocs (#30735)
Co-authored-by: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
2024-08-14 10:42:23 +00:00