GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — codegen should error on unknown XML attributes in tags · Issue #821 · DFHack/df-structures

codegen should error on unknown XML attributes in tags #821

New issue
Copy link
New issue
Copy link
Open
Open
codegen should error on unknown XML attributes in tags#821
Copy link

Description

@ab9rf
ab9rf
opened on Jan 22, 2025
Issue body actions

I recently typoed typename for type-name in a structure definition. codegen silently accepted this erroneous definition instead of warning or erroring.

Activity

  1. lethosor commented on Jan 23, 2025

    @lethosor
    lethosor
    on Jan 23, 2025
    Member
    More actions

    Echoing Discord: this is hard because

    • we don't have an exhaustive list of allowed attributes in codegen already
    • some attributes have defaults (whether they should is another matter...)

    maybe the answer is to do schema validation before ingesting files, if we can do that easily from perl.

  2. quietust commented on Aug 7, 2025

    @quietust
    quietust
    on Aug 7, 2025
    Member
    More actions

    The xmllint tool appears to be capable of catching those errors - whenever I do structure updates, I run this script to verify them first:

    #!/bin/sh
    xmllint --schema data-definition.xsd --noout df.*.xml 2>&1 | grep -v validates
    ./codegen.pl
    git status
    
  3. lethosor commented on Aug 8, 2025

    @lethosor
    lethosor
    on Aug 8, 2025
    Member
    More actions

    And we run that in CI:

    df-structures/.github/workflows/build.yml

    Line 20 in 7c4f3e3

    xmllint --schema data-definition.xsd --noout df.*.xml symbols.xml 2>&1 | tee xmllint.out; status=${PIPESTATUS[0]}

  4. quietust commented on Aug 8, 2025

    @quietust
    quietust
    on Aug 8, 2025
    Member
    More actions

    Indeed - that's where I got it from (though I also filter out the "validates" lines so that the output is empty if there are no problems).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.