.pre-commit-config.yaml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. - 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.1.1
  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. - id: check-google-doc-style
  35. - id: markdown-toc
  36. - repo: https://github.com/codespell-project/codespell
  37. rev: v1.17.1
  38. hooks:
  39. - id: codespell
  40. args: ['-I', '.codespell_ignore']
  41. exclude: '^src/jekyll/Gemfile.lock$'
  42. - repo: local
  43. hooks:
  44. - id: proposal-list
  45. name: Update list of proposals
  46. description: Updates the list of proposals in proposals/README.md
  47. entry: src/scripts/update_proposal_list.py
  48. language: python
  49. files: ^proposals/(README|p.*)\.md$
  50. pass_filenames: false
  51. # Formatters should be run late so that they can re-format any prior changes.
  52. - repo: https://github.com/psf/black
  53. rev: 20.8b1
  54. hooks:
  55. - id: black
  56. - repo: https://github.com/prettier/pre-commit
  57. rev: v2.1.2
  58. hooks:
  59. - id: prettier
  60. exclude: ^src/jekyll/theme/
  61. # Run linters last, as formatters and other checks may fix issues.
  62. - repo: https://gitlab.com/PyCQA/flake8
  63. rev: 3.8.4
  64. hooks:
  65. - id: flake8