2022-02-22 17:42:16 +03:00
|
|
|
# See https://pre-commit.com for more information
|
|
|
|
# See https://pre-commit.com/hooks.html for more hooks
|
|
|
|
repos:
|
2022-04-14 12:15:19 +03:00
|
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
2022-02-22 17:42:16 +03:00
|
|
|
rev: v3.2.0
|
|
|
|
hooks:
|
2022-04-14 12:15:19 +03:00
|
|
|
- id: trailing-whitespace
|
2022-04-27 10:09:57 +03:00
|
|
|
exclude: /test/.*$(?<!\.ql)(?<!\.qll)(?<!\.qlref)
|
2022-04-14 12:15:19 +03:00
|
|
|
- id: end-of-file-fixer
|
2022-04-27 10:09:57 +03:00
|
|
|
exclude: /test/.*$(?<!\.ql)(?<!\.qll)(?<!\.qlref)
|
2022-02-24 12:55:53 +03:00
|
|
|
|
2022-04-14 12:15:19 +03:00
|
|
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
|
|
|
rev: v13.0.1
|
2022-02-22 17:42:16 +03:00
|
|
|
hooks:
|
2022-04-14 12:15:19 +03:00
|
|
|
- id: clang-format
|
|
|
|
files: ^swift/.*\.(h|c|cpp)$
|
|
|
|
|
2022-06-23 18:05:21 +03:00
|
|
|
- repo: https://github.com/pre-commit/mirrors-autopep8
|
|
|
|
rev: v1.6.0
|
|
|
|
hooks:
|
|
|
|
- id: autopep8
|
2022-11-15 17:00:30 +03:00
|
|
|
files: ^swift/.*\.py
|
2022-06-23 18:05:21 +03:00
|
|
|
|
2022-04-14 12:15:19 +03:00
|
|
|
- repo: local
|
|
|
|
hooks:
|
|
|
|
- id: codeql-format
|
2022-02-22 17:42:16 +03:00
|
|
|
name: Fix QL file formatting
|
|
|
|
files: \.qll?$
|
|
|
|
language: system
|
|
|
|
entry: codeql query format --in-place
|
2022-02-24 12:55:53 +03:00
|
|
|
|
2022-04-14 12:15:19 +03:00
|
|
|
- id: sync-files
|
2022-02-22 17:42:16 +03:00
|
|
|
name: Fix files required to be identical
|
2022-11-03 15:04:33 +03:00
|
|
|
files: \.(qll?|qhelp|swift)$|^config/identical-files\.json$
|
2022-02-22 17:42:16 +03:00
|
|
|
language: system
|
|
|
|
entry: python3 config/sync-files.py --latest
|
|
|
|
pass_filenames: false
|
2022-02-24 12:55:53 +03:00
|
|
|
|
2022-04-14 12:15:19 +03:00
|
|
|
- id: qhelp
|
2022-02-24 12:55:53 +03:00
|
|
|
name: Check query help generation
|
|
|
|
files: \.qhelp$
|
|
|
|
language: system
|
|
|
|
entry: python3 misc/scripts/check-qhelp.py
|
2022-04-14 12:15:19 +03:00
|
|
|
|
|
|
|
- id: swift-codegen
|
|
|
|
name: Run Swift checked in code generation
|
2022-11-18 18:29:19 +03:00
|
|
|
files: ^swift/(schema.py$|codegen/|.*/generated/|ql/lib/(swift\.dbscheme$|codeql/swift/elements)|ql/\.generated.list)
|
2022-04-14 12:15:19 +03:00
|
|
|
language: system
|
2022-06-20 18:45:07 +03:00
|
|
|
entry: bazel run //swift/codegen -- --quiet
|
2022-04-14 12:15:19 +03:00
|
|
|
pass_filenames: false
|
2022-04-26 19:22:40 +03:00
|
|
|
|
|
|
|
- id: swift-codegen-unit-tests
|
|
|
|
name: Run Swift code generation unit tests
|
2022-04-27 10:09:57 +03:00
|
|
|
files: ^swift/codegen/.*\.py$
|
2022-04-26 19:22:40 +03:00
|
|
|
language: system
|
2022-04-28 11:47:48 +03:00
|
|
|
entry: bazel test //swift/codegen/test
|
2022-04-26 19:22:40 +03:00
|
|
|
pass_filenames: false
|