2
0

.pre-commit-config.yaml 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. repos:
  2. - repo: https://github.com/astral-sh/ruff-pre-commit
  3. rev: v0.6.9
  4. hooks:
  5. - id: ruff
  6. name: "Ruff linter"
  7. args: [ netbox/ ]
  8. - repo: local
  9. hooks:
  10. - id: django-check
  11. name: "Django system check"
  12. description: "Run Django's internal check for common problems"
  13. entry: python netbox/manage.py check
  14. language: system
  15. pass_filenames: false
  16. types: [python]
  17. - id: django-makemigrations
  18. name: "Django migrations check"
  19. description: "Check for any missing Django migrations"
  20. entry: python netbox/manage.py makemigrations --check
  21. language: system
  22. pass_filenames: false
  23. types: [python]
  24. - id: openapi-check
  25. name: "Validate OpenAPI schema"
  26. description: "Check for any unexpected changes to the OpenAPI schema"
  27. files: api/.*\.py$
  28. entry: scripts/verify-openapi.sh
  29. language: system
  30. pass_filenames: false
  31. types: [python]
  32. - id: mkdocs-build
  33. name: "Build documentation"
  34. description: "Build the documentation with mkdocs"
  35. files: 'docs/'
  36. entry: mkdocs build
  37. language: system
  38. pass_filenames: false
  39. - id: yarn-validate
  40. name: "Yarn validate"
  41. description: "Check UI ESLint, TypeScript, and Prettier compliance"
  42. files: 'netbox/project-static/'
  43. entry: yarn --cwd netbox/project-static validate
  44. language: system
  45. pass_filenames: false
  46. - id: verify-bundles
  47. name: "Verify static asset bundles"
  48. description: "Ensure that any modified static assets have been compiled"
  49. files: 'netbox/project-static/'
  50. entry: scripts/verify-bundles.sh
  51. language: system
  52. pass_filenames: false