From 80586265c3917993b69fa5e73899cbe63e18579f Mon Sep 17 00:00:00 2001 From: TheRealArthurDent Date: Wed, 23 Oct 2024 06:25:01 +0200 Subject: [PATCH] style: pre-commit --- .editorconfig | 3 + .pre-commit-config.yaml | 21 ++++++- renovate.json | 122 +++++++++++++++++++++++++++------------- 3 files changed, 104 insertions(+), 42 deletions(-) diff --git a/.editorconfig b/.editorconfig index 9d3c2fe..2d4365a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -18,3 +18,6 @@ indent_size = 2 [*.{yaml,yml}] indent_style = space indent_size = 2 + +[*.json] +indent_size = 2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 048562a..10e8045 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,20 +1,37 @@ # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks +exclude: '.vscode/.*' repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + # renovate: datasource=github-releases depName=pre-commit-hooks packageName=pre-commit/pre-commit-hooks + rev: v5.0.0 hooks: + - id: no-commit-to-branch + args: [--branch, main] - id: trailing-whitespace - id: end-of-file-fixer + - id: check-json + - id: pretty-format-json + args: + - "--autofix" - id: check-yaml - id: check-added-large-files - repo: https://github.com/renovatebot/pre-commit-hooks - rev: 38.110.1 + # renovate: datasource=github-releases depName=renovate-config-validator packageName=renovatebot/pre-commit-hooks + rev: 38.129.2 hooks: - id: renovate-config-validator + language_version: 20.18.0 - repo: https://github.com/rhysd/actionlint + # renovate: datasource=github-releases depName=actionlint packageName=rhysd/actionlint rev: v1.7.3 hooks: - id: actionlint-docker + + - repo: https://github.com/igorshubovych/markdownlint-cli + # renovate: datasource=github-releases depName=markdownlint packageName=igorshubovych/markdownlint-cli + rev: v0.42.0 + hooks: + - id: markdownlint-docker diff --git a/renovate.json b/renovate.json index 57848dd..84e4707 100644 --- a/renovate.json +++ b/renovate.json @@ -1,42 +1,84 @@ { - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "reviewers": [ - "TheRealArthurDent" - ], - "packageRules": [ - { - "description": "Auto merge all minor and patch updates to github-actions, pip_requirements and pyenv. Do it without a PR to reduce noise.", - "groupName": "auto merge", - "matchManagers": [ - "github-actions", - "pip_requirements", - "pyenv" - ], - "matchUpdateTypes": [ - "minor", - "patch", - "pin", - "digest" - ], - "automerge": true, - "addLabels": [ - "auto-merge" - ], - "automergeType": "branch" - }, - { - "description": "Create PRs for major changes to github-actions, pip_requirements and pyenv.", - "groupName": "MAJOR", - "commitMessagePrefix": "[MAJOR] ", - "matchManagers": [ - "github-actions", - "pip_requirements", - "pyenv" - ], - "matchUpdateTypes": [ - "major" - ], - "automerge": false - } - ] + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "packageRules": [ + { + "addLabels": [ + "auto-merge" + ], + "automerge": true, + "automergeType": "branch", + "description": "Auto merge all minor and patch updates to github-actions, pip_requirements and pyenv. Do it without a PR to reduce noise.", + "groupName": "auto merge", + "matchManagers": [ + "github-actions", + "pip_requirements", + "pyenv" + ], + "matchUpdateTypes": [ + "minor", + "patch", + "pin", + "digest" + ] + }, + { + "automerge": false, + "commitMessagePrefix": "[MAJOR] ", + "description": "Create PRs for major changes to github-actions, pip_requirements and pyenv.", + "groupName": "MAJOR", + "matchManagers": [ + "github-actions", + "pip_requirements", + "pyenv" + ], + "matchUpdateTypes": [ + "major" + ] + }, + { + "addLabels": [ + "auto-merge" + ], + "automerge": true, + "automergeType": "branch", + "description": "Auto merge all minor and patch updates to pre-commit actions. Do it without a PR to reduce noise.", + "groupName": "pre-commit", + "matchDatasources": [ + "github-releases" + ], + "matchManagers": [ + "regex" + ], + "matchUpdateTypes": [ + "minor", + "patch", + "pin", + "digest" + ], + "schedule": [ + "before 5am on Tuesday" + ] + }, + { + "automerge": false, + "commitMessagePrefix": "[MAJOR] ", + "description": "Create PRs for major changes to pre-commit actions.", + "groupName": "pre-commit MAJOR", + "matchDatasources": [ + "github-releases" + ], + "matchManagers": [ + "regex" + ], + "matchUpdateTypes": [ + "major" + ], + "schedule": [ + "before 5am on Tuesday" + ] + } + ], + "reviewers": [ + "TheRealArthurDent" + ] }