.pre-commit-config.yaml 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.2.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. - id: check-yaml
  18. - id: detect-private-key
  19. - id: end-of-file-fixer
  20. - id: mixed-line-ending
  21. args: ['--fix=lf']
  22. - id: trailing-whitespace
  23. - repo: https://github.com/google/pre-commit-tool-hooks
  24. rev: v1.0.3
  25. hooks:
  26. - id: check-copyright
  27. args:
  28. - --copyright
  29. - |+
  30. Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  31. Exceptions. See /LICENSE for license information.
  32. SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  33. exclude: '^src/jekyll/(Gemfile.lock|theme/.*)$'
  34. - repo: https://github.com/codespell-project/codespell
  35. rev: v1.17.1
  36. hooks:
  37. - id: codespell
  38. args: ['-I', '.codespell_ignore']
  39. exclude: '^src/jekyll/Gemfile.lock$'
  40. - repo: local
  41. hooks:
  42. - id: markdown-toc
  43. name: Update table of contents
  44. description: Runs https://github.com/jonschlinkert/markdown-toc
  45. entry: src/scripts/pre_commit_toc.js
  46. language: node
  47. additional_dependencies: [markdown-toc]
  48. files: .*\.md$
  49. exclude: ^src/jekyll/theme/
  50. - id: proposal-list
  51. name: Update list of proposals
  52. description: Updates the list of proposals in proposals/README.md
  53. entry: src/scripts/update_proposal_list.py
  54. language: python
  55. files: ^proposals/(README|p.*)\.md$
  56. pass_filenames: false
  57. # Formatters should be run late so that they can re-format any prior changes.
  58. - repo: https://github.com/psf/black
  59. rev: 20.8b1
  60. hooks:
  61. - id: black
  62. - repo: https://github.com/prettier/prettier
  63. rev: 2.1.1
  64. hooks:
  65. - id: prettier
  66. exclude: ^src/jekyll/theme/