Skip to content

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

Description

@jharmsen-chainalysis

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 renovatebot/renovate#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

files: '(^|/).?renovate(?:rc)?(?:\.json5?)?$'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Datasource

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions