Skip to content

cosmosgen: proto files inside .git are not ignored #1249

@hallazzang

Description

@hallazzang

Please see these two lines:
https://github.com/tendermint/starport/blob/73a5169b0d37eb9ab7dda1c150da04dc8ca1d1c3/starport/pkg/cosmosanalysis/module/module.go#L227
https://github.com/tendermint/starport/blob/73a5169b0d37eb9ab7dda1c150da04dc8ca1d1c3/starport/pkg/protoanalysis/protoanalysis.go#L32

The PatternRecursive function just appends "/**/*.proto" to the input dir.
If the directory contains a git directory(.git), then files that should be ignored are parsed too, causing an error like:

🛠️  Building proto...
cannot build app:

        <input>:1:1: found "0000000000000000000000000000000000000000" but expected [.proto element {comment|option|import|syntax|enum|service|p
ackage|message}]

When I print-debugged, the error above occurred when trying to parse <project directory>/.git/logs/refs/remotes/upstream/....proto.

I think we should ignore files within git directory by skipping those files when parsing or we should use different pattern for finding proto files.

Metadata

Metadata

Assignees

Labels

help wantedExtra attention is neededtype:errorSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions