Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Buf files#37

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
nimratcoderabbit wants to merge1 commit intomain
base:main
Choose a base branch
Loading
frompreview/buf
Open
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletionsbad.proto
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
syntax = "proto3";

package exampletest;

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Package-directory mismatch breaksbuf lint &buf build.

buf expects every file declaringpackage exampletest; to live underexampletest/.
Becausebad.proto sits at repository root (.), CI will fail withPACKAGE_DIRECTORY_MATCH.
Move the file or change thepackage declaration so they match.

-// current location: bad.proto+// preferred: exampletest/bad.proto  (move the file)

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 Buf (1.55.1)

3-3: Files with package "exampletest" must be within a directory "exampletest" relative to root but were in directory ".".

(PACKAGE_DIRECTORY_MATCH)

🤖 Prompt for AI Agents
In bad.proto at line 3, the package declaration 'package exampletest;' does notmatch the file location, causing buf lint and build errors. To fix this, eithermove bad.proto into an 'exampletest/' directory to align with the package nameor change the package declaration to match the current directory (e.g., 'packageexampletest;' to 'package root;' if staying at root). Ensure the packagedeclaration and file path correspond to satisfy buf's PACKAGE_DIRECTORY_MATCHrule.


message user_info {

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

PascalCase message names are required – renameuser_infoUserInfo.

Lower-snake message identifiers violate Google & Buf style guides and will be flagged (MESSAGE_NAMES_UPPER_CAMEL_CASE).
Refactor now to avoid cascading code-gen churn later.

-message user_info {+message UserInfo {
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
messageuser_info {
messageUserInfo {
🤖 Prompt for AI Agents
In bad.proto at line 5, the message name `user_info` uses lower-snake case whichviolates style guides requiring PascalCase. Rename the message from `user_info`to `UserInfo` to comply with the MESSAGE_NAMES_UPPER_CAMEL_CASE rule and preventfuture code generation issues.

string full_name = 1;
int32 age_years = 2;
}

enum status {
UNKNOWN = 0;
ACTIVE = 1;
INACTIVE = 2;
}
Comment on lines +10 to +14

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Enum & value naming do not comply with proto3 conventions.

  1. Enum identifiers must be PascalCase →Status.
  2. Enum values must be UPPER_SNAKE and prefixed with the enum name →STATUS_UNKNOWN,STATUS_ACTIVE,STATUS_INACTIVE.
    Fixing this keeps generated code idiomatic and passesENUM_ZERO_VALUE_SUFFIX /ENUM_VALUE_PREFIX.
-enum status {-  UNKNOWN  = 0;-  ACTIVE   = 1;-  INACTIVE = 2;+enum Status {+  STATUS_UNKNOWN  = 0;+  STATUS_ACTIVE   = 1;+  STATUS_INACTIVE = 2; }
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
enumstatus {
UNKNOWN = 0;
ACTIVE = 1;
INACTIVE = 2;
}
enumStatus {
STATUS_UNKNOWN = 0;
STATUS_ACTIVE = 1;
STATUS_INACTIVE = 2;
}
🤖 Prompt for AI Agents
In bad.proto around lines 10 to 14, rename the enum identifier from lowercase'status' to PascalCase 'Status' and update all enum values to be uppercase withthe enum name as a prefix, changing 'UNKNOWN' to 'STATUS_UNKNOWN', 'ACTIVE' to'STATUS_ACTIVE', and 'INACTIVE' to 'STATUS_INACTIVE' to comply with proto3naming conventions and pass linting rules.



[8]ページ先頭

©2009-2025 Movatter.jp