Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider reporting a warning when top-level configuration properties are indented #1225

Closed
jafeltra opened this issue Feb 24, 2023 · 1 comment · Fixed by #1265
Closed

Consider reporting a warning when top-level configuration properties are indented #1225

jafeltra opened this issue Feb 24, 2023 · 1 comment · Fixed by #1265

Comments

@jafeltra
Copy link
Collaborator

When a top-level sushi-config property is incorrectly indented in the YAML file, SUSHI will not process it correctly. This is because it is technically still valid YAML, but the results are likely not what the user intended. For example, something like this is not processed how it it was likely intended:

id: fhir.example
canonical: http://example.org
name: ExampleIG
status: draft
version: 0.1.0
fhirVersion: 4.3.0
copyrightYear: 2021+
releaseLabel: ci-build
pages:
  index.md:
    title: IG Home

  menu:
    Home: index.html

menu is considered a page.

Consider adding a warning in SUSHI if an item that is expected at the top level of the config file is present but not at the top level.

Some things to consider:

  • This may be an intentional choice. The YAML is valid so it could be exactly what the user intended. Should we be warning on a case that could be intentional and there will be no way to resolve the warning?
  • Is this even a case that is feasible to detect with the YAML library we are using?
  • This is only an issue when a property is incorrectly indented underneath a list because it is grouped with that list. In the above example, without the pages property, SUSHI will already report an error because the YAML is not valid ("All collection items must start at the same column.").
@cmoesel
Copy link
Member

cmoesel commented Mar 9, 2023

I'd suggest that maybe we should just warn on any property (in any place) that we don't know how to handle. The case above is a little trickier since it is in the pages object, but even then, a page entry should end in .md or .xml -- so we can still generally detect this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants