2
1

sample_python_yamllint.py 294 B

12345678910111213
  1. # example form https://yamllint.readthedocs.io/en/stable/development.html
  2. from yamllint import (config, linter)
  3. data = '''---
  4. - &anchor
  5. foo: bar
  6. - *anchor
  7. '''
  8. yaml_config = config.YamlLintConfig("extends: default")
  9. for p in linter.run(data, yaml_config):
  10. print(p.desc, p.line, p.rule)