mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
This enables use of the `pre-commit` framework to run quick pre-commit checks. In particular this allows to automatically fix: * trailing white spaces * absence or multiple newlines at the end of files * QL code formatting * file sync More could be added in the future: anything that can be checked fast can be added in the configuration (for example well-formedness of `qldoc` files). This is a purely opt-in feature. Instructions for enabling it and possibly configuring its behaviour are in `pre-commit-hook-setup.md`.
22 lines
672 B
YAML
22 lines
672 B
YAML
# See https://pre-commit.com for more information
|
|
# See https://pre-commit.com/hooks.html for more hooks
|
|
exclude: /test/.*$(?<!\.ql)(?<!\.qll)(?<!\.qlref)
|
|
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v3.2.0
|
|
hooks:
|
|
- id: trailing-whitespace
|
|
- id: end-of-file-fixer
|
|
- repo: local
|
|
hooks:
|
|
- id: codeql-format
|
|
name: Fix QL file formatting
|
|
files: \.qll?$
|
|
language: system
|
|
entry: codeql query format --in-place
|
|
- id: sync-files
|
|
name: Fix files required to be identical
|
|
language: system
|
|
entry: python3 config/sync-files.py --latest
|
|
pass_filenames: false
|