Ejemplo n.º 1
0
class NitpickJSONFileSectionSchema(BaseNitpickSchema):
    """Validation schema for the ``[nitpick.JSONFile]`` section on the style file."""

    error_messages = {
        "unknown":
        help_message("Unknown configuration",
                     "nitpick_section.html#nitpick-jsonfile")
    }

    file_names = fields.List(fields.String)
Ejemplo n.º 2
0
class SetupCfgSchema(BaseNitpickSchema):
    """Validation schema for setup.cfg."""

    error_messages = {
        "unknown":
        help_message("Unknown configuration",
                     "nitpick_section.html#comma-separated-values")
    }

    comma_separated_values = fields.List(
        fields.String(validate=fields.validate_section_dot_field))
Ejemplo n.º 3
0
class TextSchema(Schema):
    """Validation schema for the text file TOML configuration."""

    error_messages = {"unknown": help_message("Unknown configuration", TEXT_FILE_RTFD_PAGE)}
    contains = fields.List(fields.Nested(TextItemSchema))
Ejemplo n.º 4
0
class JSONFileSchema(BaseNitpickSchema):
    """Validation schema for any JSON file added to the style."""

    contains_keys = fields.List(fields.FilledString)
    contains_json = fields.Dict(fields.FilledString, fields.JSONString)