googleapis / googleapis/api-linter
0191 proto-package is broken when api-linter runs in parent directory
- Dominant language
- Go
- Stars
- 765
- Forks
- 181
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 3
Description
#### Environment details
- Programming language: N/A
- OS: Linux
- Language runtime version: N/A
- Package version: v1.30.1
#### Steps to reproduce
We keep proto-files in `api/proto/` subdirectory and run `api-linter` in repo root directory. Using v1.25.0 this works just fine, but with v1.30.1 it doesn't work anymore. The possible workaround is to run `api-linter` in `api/proto/` subdirectory instead of repo root.
```
$ head -n 3 api/proto/mstrade/ratelimit/service.proto
syntax = "proto3";
package mstrade.ratelimit;
$ api-linter --config .api-linter.yml -I api/proto -I third_party/googleapis/api-common-protos api/proto/mstrade/ratelimit/service.proto
- file_path: api/proto/mstrade/ratelimit/service.proto
problems:
- message: 'Proto package and directory structure mismatch: The proto package must
match the proto directory structure.'
location:
start_position:
line_number: 3
column_number: 1
end_position:
line_number: 3
column_number: 26
rule_id: core::0191::proto-package
rule_doc_uri: https://linter.aip.dev/191/proto-package
$ api-linter --config ../../.api-linter.yml -I ../../third_party/googleapis/api-common-protos mstrade/ratelimit/service.proto
- file_path: mstrade/ratelimit/service.proto
problems: []
```
Contributor guide
Assessment
This issue has not been assessed yet.