renovatebot / renovatebot/pre-commit-hooks

bug: renovate.jsonc files are skipped by config validator hook

Open Beginner friendly
#4,474 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
49
Forks
10
Avg merge
1m
Merged PRs (30d)
176

Description

Problem

The renovate-config-validator hook will not run natively on renovate.jsonc files because the files regex does not match this file suffix. Per https://docs.renovatebot.com/configuration-options/ and https://github.com/renovatebot/renovate/pull/43677, .jsonc files should be natively supported.

Steps to Reproduce

Create a basic renovate.jsonc file:

{
  // Minimal JSONC Renovate config.
  "$schema": "https://docs.renovatebot.com/renovate-schema.json",
  "extends": ["config:recommended"]
}

Create a basic .pre-commit-config.yaml:

repos:
  - repo: https://github.com/renovatebot/pre-commit-hooks
    rev: 43.256.1
    hooks:
      - id: renovate-config-validator

Run pre-commit, see that the .jsonc file is skipped:

❯ pre-commit run renovate-config-validator --files renovate.jsonc --verbose
renovate-config-validator............................(no files to check)Skipped
- hook id: renovate-config-validator
Proposed Solution

Update the file regex to support .jsonc
https://github.com/renovatebot/pre-commit-hooks/blob/b13b75918788a1dfe8fada6995adcab221087998/.pre-commit-hooks.yaml#L9

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at .pre-commit-hooks.yaml line 9, where the hook's files regex is defined. Run the reported pre-commit command against renovate.jsonc before and after the change. Done means the hook no longer reports no files to check and runs on the JSONC file.

Written by the indexing model from the issue text.

Assessment

Tech stack
yaml
Domain
tooling
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
90/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.