Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7577266

Browse files
authored
feat: add base preset (#2)
1 parent 124fd01 commit 7577266

4 files changed

Lines changed: 125 additions & 25 deletions

File tree

.markdownlint.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# https://github.com/DavidAnson/markdownlint?tab=readme-ov-file#rules--aliases
2+
3+
line-length: false

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,21 @@ repos:
2828
args: ["--verbose"]
2929
additional_dependencies: ["json5"]
3030

31+
- repo: https://github.com/executablebooks/mdformat
32+
rev: 1.0.0
33+
hooks:
34+
- id: mdformat
35+
language: python
36+
args: [--number, --compact-tables]
37+
additional_dependencies:
38+
- mdformat-gfm-alerts==2.0.0
39+
- mdformat-gfm==1.0.0
40+
41+
- repo: https://github.com/DavidAnson/markdownlint-cli2
42+
rev: v0.22.0
43+
hooks:
44+
- id: markdownlint-cli2
45+
3146
# zizmor detects security vulnerabilities in GitHub Actions workflows.
3247
- repo: https://github.com/woodruffw/zizmor-pre-commit
3348
rev: v1.23.1

README.md

Lines changed: 32 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,40 @@ To use a preset in your project's config, add it to the [`extends`](https://docs
1616
}
1717
```
1818

19-
2019
## Presets
2120

2221
All presets are located in the `presets` directory.
2322

23+
### [base](./presets/base.json5)
24+
25+
A base preset extending Renovate's [config:recommended](https://docs.renovatebot.com/presets-config/#configrecommended) preset.
26+
It does not extend [config:best-practices](https://docs.renovatebot.com/presets-config/#configbest-practices) directly in order to set a blanket [minimum release age](https://docs.renovatebot.com/key-concepts/minimum-release-age/) of 7 days.
27+
See the below table for commonalities and differences between this preset and `config:best-practices`:
28+
29+
| - | `base` | `config:best-practices` |
30+
| -- | -- | -- |
31+
| Base Config | `config:recommended` | `config:recommended` |
32+
| Enable Config Migration via [`:configMigration`](https://docs.renovatebot.com/presets-default/#configmigration) | Yes | Yes |
33+
| Highlight abandoned packages via [`abondonments:recommended`](https://docs.renovatebot.com/presets-abandonments/) | Yes | Yes |
34+
| Maintain Lock Files via [`:maintainLockFilesWeekly`](https://docs.renovatebot.com/presets-default/#maintainlockfilesweekly) | Yes | Yes |
35+
| GitHub Actions digest pinning | Yes, via [`helpers:pinGitHubActionDigestsToSemver`](https://docs.renovatebot.com/presets-helpers/#helperspingithubactiondigeststosemver) (adds SemVer extraction and comments) | Yes, via [`helpers:pinGitHubActionDigests`](https://docs.renovatebot.com/presets-helpers/#helperspingithubactiondigests) |
36+
| [Minimum Release Age](https://docs.renovatebot.com/key-concepts/minimum-release-age/) | 7 days across all package managers | 3 days for npm only via [`security:minimumReleaseAgeNpm`](https://docs.renovatebot.com/presets-security/#securityminimumreleaseagenpm) |
37+
| Pin Docker digests via [`docker:pinDigests`](https://docs.renovatebot.com/presets-docker/#dockerpindigests) | No | Yes |
38+
| Pin dependencies | Yes, via [`:pinAllExceptPeerDependencies`](https://docs.renovatebot.com/presets-default/#pinallexceptpeerdependencies) | Yes, via [`:pinDevDependencies`](https://docs.renovatebot.com/presets-default/#pindevdependencies) |
39+
40+
In addition, the `base` preset sets the following configuration options:
41+
42+
- Separate multiple major version updates via [`separateMultipleMajor`](https://docs.renovatebot.com/configuration-options/#separatemultiplemajor)
43+
- Enable Alpine Docker image variant updates via [`docker-alpine.json5`](#docker-alpine) below
44+
- Support version updates for version inputs in GitHub Actions via [`actions-dependency-version.json5`](#actions-dependency-version) below
45+
- Enable pre-commit support via [`pre-commit-hooks.json5`](#pre-commit-hooks) below
46+
- Separate minor and patch version updates for Python and MariaDB
47+
- Combine updates for
48+
- the `markdownlint-cli2` image and pre-commit hook
49+
- the `mkdocs-material` image and package
50+
- the `ruff` package and pre-commit hook
51+
- the `uv` package and pre-commit hook
52+
2453
### [docker-alpine](./presets/docker-alpine.json5)
2554

2655
Use this to ensure that Alpine versions in Docker base images receive updates.
@@ -40,37 +69,15 @@ And, update this version when `uv` is updated.
4069
With this preset you can do that as follows:
4170

4271
```yaml
43-
- uses: astral-sh/setup-uv@v5.2.1
72+
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
4473
with:
4574
# renovate: datasource=pypi depName=uv
46-
version: "0.5.25"
75+
version: "0.11.2"
4776
```
4877
4978
> [!NOTE]
5079
> You can achieve the same outcome using `_VERSION` environment variables using the custom manager [customManagers:githubActionsVersions](https://docs.renovatebot.com/presets-customManagers/#custommanagersgithubactionsversions) provided by Renovate.
5180

52-
### [requires-python](https://github.com/mschoettle/renovate-presets/blob/08df8cf3920b3f17d69ed5f5c33b1845e52f288b/presets/requires-python.json5) (**deprecated**)
53-
54-
Use this preset to pin a Python version in `requires-python` in your `pyproject.toml`.
55-
For example, instead of also specifying the specific Python version in `.python-version` you can be more specific in your `pyproject.toml`:
56-
57-
```toml
58-
[project]
59-
requires-python = "3.13.*"
60-
```
61-
62-
or
63-
64-
```toml
65-
[project]
66-
requires-python = "3.13.2"
67-
```
68-
69-
This preset ensures that the required Python version is updated.
70-
71-
> [!NOTE]
72-
> Renovate can [handle this natively now](https://github.com/renovatebot/renovate/discussions/34793#discussioncomment-12997906).
73-
7481
### [pre-commit-hooks](./presets/pre-commit-hooks.json5)
7582

7683
This preset enables updates the [pre-commit manager](https://docs.renovatebot.com/modules/manager/pre-commit/) and groups pre-commit hook updates together.

presets/base.json5

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": [
4+
// Based on config:recommended preset but we include best practices from config:best-practices
5+
// https://docs.renovatebot.com/presets-config/#configrecommended
6+
// https://docs.renovatebot.com/presets-config/#configbest-practices
7+
"config:recommended",
8+
// https://docs.renovatebot.com/presets-default/#separatemultiplemajorreleases
9+
":separateMultipleMajorReleases",
10+
// Keep uv lockfile updated regularly
11+
// https://docs.renovatebot.com/configuration-options/#lockfilemaintenance
12+
// https://docs.renovatebot.com/presets-default/#maintainlockfilesweekly
13+
":maintainLockFilesWeekly",
14+
// https://docs.renovatebot.com/presets-default/#configmigration
15+
":configMigration",
16+
// https://docs.renovatebot.com/presets-default/#pinallexceptpeerdependencies
17+
":pinAllExceptPeerDependencies",
18+
// https://docs.renovatebot.com/presets-abandonments/#abandonmentsrecommended
19+
"abandonments:recommended",
20+
// https://docs.renovatebot.com/presets-helpers/#helperspingithubactiondigeststosemver
21+
"helpers:pinGitHubActionDigestsToSemver",
22+
// see https://github.com/mschoettle/renovate-presets#presets
23+
"github>mschoettle/renovate-presets//presets/docker-alpine.json5",
24+
"github>mschoettle/renovate-presets//presets/actions-dependency-version.json5",
25+
"github>mschoettle/renovate-presets//presets/pre-commit-hooks.json5",
26+
],
27+
// Add a dependency cooldown
28+
// https://docs.renovatebot.com/key-concepts/minimum-release-age/#minimum-release-age
29+
// https://blog.yossarian.net/2025/11/21/We-should-all-be-using-dependency-cooldowns
30+
"minimumReleaseAge": "7 days",
31+
"internalChecksFilter": "strict",
32+
"packageRules": [
33+
// Allow to receive patch updates for MariaDB and Python while waiting with upgrading to the next minor version
34+
{
35+
"matchPackageNames": [
36+
"python",
37+
"mariadb",
38+
],
39+
"extends": [
40+
":separatePatchReleases",
41+
],
42+
},
43+
// Combine markdownlint-cli2 image and pre-commit hook
44+
{
45+
"matchPackageNames": ["/markdownlint-cli2/"],
46+
"groupName": "markdownlint-cli2",
47+
},
48+
// Combine mkdocs-material updates for Python and Docker
49+
{
50+
"matchPackageNames": ["mkdocs-material"],
51+
"groupName": "mkdocs-material"
52+
},
53+
// Exclude uv and ruff pre-commits from pre-commit hooks group
54+
// to avoid adding config options from the pre-commit hooks preset
55+
{
56+
"matchManagers": [
57+
"pre-commit",
58+
],
59+
"matchPackageNames": [
60+
"!/ruff-pre-commit/",
61+
"!/uv-pre-commit/",
62+
],
63+
},
64+
// Combine ruff and ruff-pre-commit
65+
{
66+
"matchPackageNames": ["/ruff-pre-commit|ruff$/"],
67+
"groupName": "ruff",
68+
},
69+
// Combine uv package, uv image, and uv-pre-commit
70+
{
71+
"matchPackageNames": ["/uv-pre-commit|uv$/"],
72+
"groupName": "uv",
73+
},
74+
]
75+
}

0 commit comments

Comments
 (0)