ros-infrastructure / rosdoc2

Command-line tool for generating documentation for ROS 2 packages.
Apache License 2.0
29 stars 9 forks source link

rosdoc2.yaml seems to be invalid yaml syntax #94

Closed christophfroehlich closed 2 months ago

christophfroehlich commented 2 months ago

I created a default rosdoc2.yaml with rosdoc2 default_config --package-path src/realtime_tools/, but the official pre-commit hook complains about the format

check yaml...............................................................Failed
- hook id: check-yaml
- exit code: 1

expected a single document in the stream
  in "rosdoc2.yaml", line 4, column 1
but found another document
  in "rosdoc2.yaml", line 7, column 1

Removing this line fixes this https://github.com/ros-infrastructure/rosdoc2/blob/0403657aa032ead0a9e02b173f737e49206cbbac/rosdoc2/verbs/build/inspect_package_for_settings.py#L28 but then the config parser will fail https://github.com/ros-infrastructure/rosdoc2/blob/0403657aa032ead0a9e02b173f737e49206cbbac/rosdoc2/verbs/build/parse_rosdoc2_yaml.py#L29-L32

tfoote commented 2 months ago

The --- is a separator https://gettaurus.org/docs/YAMLTutorial/#YAML-Multi-Documents

Is that linter expecting a single yaml doc potentially?

christophfroehlich commented 2 months ago

Thank @tfoote for your hint. I didn't know about this yaml syntax (section 2.2) and haven't investigated this further. But the pre-commit hook has even an option for that

      - id: check-yaml
        args: ["--allow-multiple-documents"]

and everything is fine! Sorry for the noise..