Skip to content

Homogenize writer conventions across targets #339

@joshsh

Description

@joshsh

All Hydra writers (serializers) use the hydra.serialization module to create expressions of type hydra.ast.Expr, which are then actually mapped to strings, independently of any particular writer. The whitespace of the resulting string is specified in the Expr according to tightly constrained patterns. However, the writers still have a lot of freedom w.r.t. where they wrap lines and indent blocks. Some do a better job of creating compact, readable code than others, keeping lines less than 120 characters in length and breaking in logical places. Others haven't received as much attention and don't do as well. Hydra's writers could use an overhaul which considers:

  1. Whether the Expr syntax and/or hydra.serialization syntax helpers can be improved in any way
  2. Whether we can provide more and better helper functions to relieve individual writers of some of the burden associated with generated readable code (e.g. line wrapping in appropriate places)
  3. How well the individual writers are using the available tools

The result will hopefully be a more consistent look and feel of Hydra-generated code across targets, and an easier on-ramp for new formats in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions