Skip to content

The validator raises on values of the wrong type instead of returning faults #4

Open

Description

@mklarmann

fileformat.errors(data) is documented to return every fault. Replacing single values of the example by values of another type (34,434 replacements) makes it raise in about 1,200 cases, from about 13 places. Examples: rule.total_tolerance: [] (TypeError in rule.classify), a scope's indicators: [[]] (unhashable list), items[0].unit: [], a claim that is a list. check then ends in a traceback, and one bad file stops it before the next file is checked.

Proposed: errors() never raises: wrong types are faults with their place. A test feeds odd types into every node of the example.

Found by sentier-bafu's agent review of pull request #2 (head 5c19866), confirmed again on 0e1f5be. Being fixed on the same branch, first-version.

Activity

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions