.pre-commit-config.yaml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. # See https://pre-commit.com for more information
  5. # See https://pre-commit.com/hooks.html for more hooks
  6. default_language_version:
  7. python: python3 # Defaults to python2, so override it.
  8. repos:
  9. - repo: https://github.com/pre-commit/pre-commit-hooks
  10. rev: v3.3.0
  11. hooks:
  12. - id: check-added-large-files
  13. - id: check-case-conflict
  14. - id: check-executables-have-shebangs
  15. - id: check-merge-conflict
  16. - id: check-symlinks
  17. exclude: '^website/jekyll/site/_includes$'
  18. - id: check-yaml
  19. - id: detect-private-key
  20. - id: end-of-file-fixer
  21. - id: mixed-line-ending
  22. args: ['--fix=lf']
  23. - id: trailing-whitespace
  24. - repo: https://github.com/google/pre-commit-tool-hooks
  25. rev: v1.1.1
  26. hooks:
  27. - id: check-copyright
  28. args:
  29. - --copyright
  30. - |+
  31. Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  32. Exceptions. See /LICENSE for license information.
  33. SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  34. exclude: '^(website/(firebase/.firebaserc|jekyll/(Gemfile.lock|theme/.*))|.bazelversion|compile_flags.txt|.*\.def)$'
  35. - id: check-google-doc-style
  36. - id: markdown-toc
  37. - repo: https://github.com/codespell-project/codespell
  38. rev: v1.17.1
  39. hooks:
  40. - id: codespell
  41. args: ['-I', '.codespell_ignore']
  42. exclude: '^website/jekyll/Gemfile.lock$'
  43. - repo: local
  44. hooks:
  45. - id: proposal-list
  46. name: Update list of proposals
  47. description: Updates the list of proposals in proposals/README.md
  48. entry: proposals/scripts/update_proposal_list.py
  49. language: python
  50. files: ^proposals/(README|p.*)\.md$
  51. pass_filenames: false
  52. # Formatters should be run late so that they can re-format any prior changes.
  53. - repo: https://github.com/psf/black
  54. rev: 20.8b1
  55. hooks:
  56. - id: black
  57. - repo: https://github.com/prettier/pre-commit
  58. rev: v2.1.2
  59. hooks:
  60. - id: prettier
  61. exclude: ^website/jekyll/theme/
  62. # Run linters last, as formatters and other checks may fix issues.
  63. - repo: https://gitlab.com/PyCQA/flake8
  64. rev: 3.8.4
  65. hooks:
  66. - id: flake8
  67. # We fully exclude fuzzer corpus directories as they are generated binary data.
  68. exclude: '^(.*/fuzzer_corpus/.*)$'