Skip to content

Buffrs enforces inconsistencies between package directive and import paths #230

Open
@NiklasRosenstein

Description

@NiklasRosenstein

Buffrs does not allow underscores in the package.name field and recommends hyphens as a word separator. On the other hand, the Protobuf package ...; directive does not accept hyphens and underscores can be used as a word separator.

This leads to inconsistencies between the package and import directive.

# Proto.toml
[package]
name = "foo-bar"
type = "api"
version = "0.1.0"
// proto/service.proto
package foo_bar;
import "foo-bar/messages.proto";

This is because Buffrs will construct the proto/vendor folder as

proto/vendor/
  foo-bar/
    service.proto
    messages.proto

I would argue that this is inconsistent and confusing for no benefit and that Buffrs should instead align with the Protobuf specification; if not for the Buffrs package.name, at least for the generated directory structure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    complexity::mediumIssues or ideas which require some discussion, research and more implementation workcomponent::cliEverything related to the buffrs clidatamodelChanges related to the Datamodelpriority::lowPlease dont work on this if you can contribute something with a higher prioritytype::refactoringChanging the inner-workings of buffrstype::styleRelated to personal or community opinions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions