[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
Diff Delta:
14
About 25 Diff Delta/hour
Classified as:  Feature Add

jameslamb's Description of Work

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!

11 total changed files
(1 file ignored)
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Loading changes...
Congrats, you've cleared the final file
Your attention span may now revert to "default human"