-
Notifications
You must be signed in to change notification settings - Fork 159
fix(cli): unexpected lint warning when providing multiple files #1496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
quirogas
merged 11 commits into
main
from
fix-unexpected_lint_warning_when_providing_mutiple_files
Jul 11, 2025
Merged
fix(cli): unexpected lint warning when providing multiple files #1496
quirogas
merged 11 commits into
main
from
fix-unexpected_lint_warning_when_providing_mutiple_files
Jul 11, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
noahdietz
reviewed
Jul 2, 2025
noahdietz
requested changes
Jul 9, 2025
Co-authored-by: Noah Dietz <[email protected]>
Co-authored-by: Noah Dietz <[email protected]>
Co-authored-by: Noah Dietz <[email protected]>
noahdietz
reviewed
Jul 10, 2025
Co-authored-by: Noah Dietz <[email protected]>
Co-authored-by: Noah Dietz <[email protected]>
noahdietz
approved these changes
Jul 11, 2025
gcf-merge-on-green bot
pushed a commit
that referenced
this pull request
Jul 16, 2025
🤖 I have created a release *beep* *boop* --- ## [1.70.0](https://togithub.com/googleapis/api-linter/compare/v1.69.2...v1.70.0) (2025-07-16) ### Features * **AIP-142:** add relative time segments comment rule ([5fab299](https://togithub.com/googleapis/api-linter/commit/5fab2997d1f81bf60b55c6ae6e3e3605212c9870)) * **AIP-142:** add time_offset type rule ([#1506](https://togithub.com/googleapis/api-linter/issues/1506)) ([945cff3](https://togithub.com/googleapis/api-linter/commit/945cff325fe38d4f8e3a7a620059a1e6b04c5107)) * **integration-tests:** add test harness for cli invocation ([#1493](https://togithub.com/googleapis/api-linter/issues/1493)) ([35be28f](https://togithub.com/googleapis/api-linter/commit/35be28f922581bff1f8ad6d2bb9289f6c57e2657)) ### Bug Fixes * **AIP-136:** support response msg lint with resource singular aligned field name ([#1499](https://togithub.com/googleapis/api-linter/issues/1499)) ([8dec010](https://togithub.com/googleapis/api-linter/commit/8dec01076c4bbeb0506c39610e325fc25bbda6ca)) * **AIP-158:** clarify pluralized response field finding ([#1498](https://togithub.com/googleapis/api-linter/issues/1498)) ([f0b7895](https://togithub.com/googleapis/api-linter/commit/f0b7895da8cd4b437ac0c3a9be2ac442560eeda8)) * **AIP-203:** field-behavior-required ignore imported request types ([#1504](https://togithub.com/googleapis/api-linter/issues/1504)) ([bb82f00](https://togithub.com/googleapis/api-linter/commit/bb82f006b37c85cf255ba8bddb1bf34a07993596)), refs [#1503](https://togithub.com/googleapis/api-linter/issues/1503) * **cli:** unexpected lint warning when providing multiple files ([#1496](https://togithub.com/googleapis/api-linter/issues/1496)) ([7ecaa42](https://togithub.com/googleapis/api-linter/commit/7ecaa4200da7b5cbcbf1c273fc77d524f346ae1c)), refs [#1465](https://togithub.com/googleapis/api-linter/issues/1465) ### Documentation * add comments to lint.Config and configuration page ([#1505](https://togithub.com/googleapis/api-linter/issues/1505)) ([39d0376](https://togithub.com/googleapis/api-linter/commit/39d0376281fb03f57b24efe0d82cb842e7316615)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Here is the revised description:
Bug
When running
api-linter
with the-I
flag for an import path that is a parent of the proto files, the linter would fail with a "symbol already defined" error. This was caused by a two-stage file resolution process that resolved the same file twice with different paths. Additionally, the linter would fail when using absolute file paths without also passing.
as an import path.For example, the following commands would fail:
Fix
Fixes #1465
The file path resolution logic in
cmd/api-linter/cli.go
has been refactored to use a single, consistent resolution step. We now resolve imports before passing them to the proto parser. This ensures that all proto files are resolved with the same set of import paths that the parser uses, preventing duplicate parsing and fixing the bugs described above.