* 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>
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>
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>
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>
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.
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>
* 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`.