semgrep.yml 1.1 KB

1234567891011121314151617181920212223242526272829
  1. rules:
  2. - id: code-block-python
  3. paths:
  4. include:
  5. # Ray Core
  6. - "python/ray/util/**/*.py"
  7. - "python/ray/_private/**/*.py"
  8. - "python/ray/core/**/*.py"
  9. - "doc/source/ray-core/**/*.rst"
  10. - "doc/source/ray-overview/**/*.rst"
  11. - "doc/source/ray-observability/**/*.rst"
  12. # Ray Data
  13. - "python/ray/data/**/*.py"
  14. - "doc/source/data/**/*.rst"
  15. # Ray Train
  16. - "python/ray/train/**/*.py"
  17. - "doc/source/train/**/*.rst"
  18. exclude:
  19. # These files use the :emphasize-lines: option, which isn't supported by testcode.
  20. - "doc/source/train/getting-started-pytorch-lightning.rst"
  21. - "doc/source/train/getting-started-pytorch.rst"
  22. - "doc/source/train/getting-started-transformers.rst"
  23. - "doc/source/train/user-guides/data-loading-preprocessing.rst"
  24. languages:
  25. - generic
  26. message: "Don't use 'code-block:: python', it's not tested! Use 'testcode' instead! For more information, see https://docs.ray.io/en/master/ray-contribute/writing-code-snippets.html."
  27. pattern: "code-block:: python"
  28. severity: ERROR