Skip to content

Dependency groups and the import order #284

Open

Description

@Kinflou

Part of #281. Proposal: ComlineProject/docs#178 (accepted in docs#181), dependency groups and import formatting.

  • The group key: an optional group = "<name>" on a dependency entry in config.idp, with first-declared order kept (read from the manifest's syntax tree, since the parsed dependency map is sorted).
  • Kept out of every hash and diff: the frozen config's hash, the dependency content hash (pins) and compat and config diffs all leave group out. The simplest way is not to freeze it. Add tests that regrouping changes no hash, pin or comparison.
  • The import-ordering function:
    • the order is std, then the package's own (package::, parent::, self::), then dependencies, with groups in first-declared order, then ungrouped dependencies;
    • imports are alphabetical within a tier, with a blank line between tiers and between groups;
    • it reads imports.order from comline.toml's [format] table strictly, so a missing, repeated or misspelt tier is an error;
    • a group never orders std.
  • Config schema: [format] goes into the comline.toml config and its JSON Schema, with no per-user override.
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

    P1NextconfigPackages, config.idp, settingstoolingCLI, language server, editor

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions