[ci] pre-commit: add check-jsonschema, other hooks #7469

Merged
jameslamb opened 1:55pm on September 29, 2026 wanted to merge 14 Ξ” into microsoft/lightgbm main from
ci/more-precommit-hooks

Pull Request Overview

  • Opened on September 29, 2026
  • Status Merged
  • Commit count 2 with first commit September 28, 2026

Total Delta

14 Total Diff Delta

Open Days

Open 4 weekdays

Test Delta

0 Diff Delta in Test Files
Breakdown by Phase

How long has this pull request spent in each phase of its lifecycle?

Fraction of total time Business days Phase
 
0.8 days Authoring 1 commit before pull request opened for review
 
0.4 days Awaiting first review
 
0.2 days Revising work with 1 commit in response to 1 review that left 3 comments
Set up deploy tracking to begin tracking full PR start-to-deploy times

Total time for pull request 1.4 business days from first commit authored to merge
Deploy tracking has not been set up

Author avatar

[ci] pre-commit: add check-jsonschema, other hooks

Contributes to #7470


  • adds check-jsonschema, to help identify mistakes in the dependabot.yml and .readthedocs.yaml files (these are sometimes hard to catch in the limited feedback from those services)

  • adds several other pre-commit/pre-commit-hooks hooks, including some enforcing stricter handling of executable markers on files

Fixes these:

R-package/DESCRIPTION: marked executable but has no (or invalid) shebang!

tests/cpp_tests/test_common.cpp: marked executable but has no (or invalid) shebang!
.ci/lint-r-code.R: marked executable but has no (or invalid) shebang!
R-package/configure.win: marked executable but has no (or invalid) shebang!

And these:

.ci/test-python-oldest.sh: has a shebang but is not marked executable!

.ci/check-python-dists.sh: has a shebang but is not marked executable!
docs/build-docs.sh: has a shebang but is not marked executable!
docs/conf.py: has a shebang but is not marked executable!

Comments Threads Pending Resolution

borchero reviewed and approved this work on September 29, 2026
borchero left a comment

Nice! I don't mind another pre-commit hook as long as it runs quickly :)

.pre-commit-config.yaml
28
      - id: fix-byte-order-marker
29
        exclude: ^windows/.*$
30
      - id: end-of-file-fixer
31
      - id: trailing-whitespace
32
  - repo: https://github.com/python-jsonschema/check-jsonschema

Resolved Comment Threads

No resolved comments have been left on this PR.