Skip to content

Pass of lint for .proto files #1223

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
merged 17 commits into from
Mar 29, 2021
Merged

Pass of lint for .proto files #1223

merged 17 commits into from
Mar 29, 2021

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Mar 16, 2021

I've used buf linter to perform linting of the .proto files.

The linter warnings rules fixed by this PR are:

  • SERVICE_SUFFIX
  • RPC_RESPONSE_STANDARD_NAME
  • RPC_REQUEST_STANDARD_NAME
  • RPC_REQUEST_RESPONSE_UNIQUE
  • ENUM_VALUE_PREFIX
  • ENUM_VALUE_UPPER_SNAKE_CASE
  • FIELD_LOWER_SNAKE_CASE
  • PACKAGE_VERSION_SUFFIX
  • PACKAGE_DIRECTORY_MATCH

The changes above should not affect the behavior of the RPC API.
Anyway, those are breaking changes since they change the signature of the RPC API and the CLI JSON output in some cases.

The remaining linter warnings require a more in-depth analysis to be fixed:

cc/arduino/cli/commands/v1/lib.proto:115:5:Enum zero value name "LIBRARY_SEARCH_STATUS_FAILED" should be suffixed with "_UNSPECIFIED".
cc/arduino/cli/commands/v1/lib.proto:282:5:Enum zero value name "LIBRARY_LAYOUT_FLAT" should be suffixed with "_UNSPECIFIED".
cc/arduino/cli/commands/v1/lib.proto:289:5:Enum zero value name "LIBRARY_LOCATION_IDE_BUILTIN" should be suffixed with "_UNSPECIFIED".
cc/arduino/cli/debug/v1/debug.proto:30:24:RPC request type "DebugConfigRequest" should be named "GetDebugConfigRequest" or "DebugServiceGetDebugConfigRequest".
cc/arduino/cli/monitor/v1/monitor.proto:53:21:Enum zero value name "TARGET_TYPE_SERIAL" should be suffixed with "_UNSPECIFIED".

Copy link
Contributor

@kittaakos kittaakos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new Arduino IDE cannot wait to use the new gRPC API 💄

@cmaglie cmaglie force-pushed the protolint branch 6 times, most recently from 7344ce6 to 298ea05 Compare March 23, 2021 23:56
@cmaglie cmaglie marked this pull request as ready for review March 24, 2021 08:45
@silvanocerza
Copy link
Contributor

Seems alright to me, I'd add a task and related workflow to check formatting otherwise I fear we'll drift into badly formatted files again.

@per1234 per1234 dismissed their stale review March 25, 2021 10:13

Requested changes have been made. Thanks!

@per1234
Copy link
Contributor

per1234 commented Mar 25, 2021

I'd add a task and related workflow to check formatting otherwise I fear we'll drift into badly formatted files again.

I agree, and suggest doing the same with buf lint.

Copy link
Contributor

@silvanocerza silvanocerza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small change in UPGRADING.md, the rest is good.

Copy link
Contributor

@silvanocerza silvanocerza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants