Skip to content

Conversation

@jbampton
Copy link
Contributor

@jbampton jbampton commented May 13, 2025

The Super-Linter found this issue today when I was working on #6398

Run protolint -fix to autofix some linter errors

Add .protolint.yaml config file and disable all rules for comments

https://github.com/yoheimuta/protolint

Hook usage listed here:

https://github.com/yoheimuta/protolint?tab=readme-ov-file#version-control-integration

Here is the style guide:

https://protobuf.dev/programming-guides/style/

Next link is an example config file:

https://github.com/yoheimuta/protolint/blob/master/_example/config/.protolint.yaml

Also updated proto_to_ruby.cpp

@jbampton jbampton requested a review from matz as a code owner May 13, 2025 11:36
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Hello @jbampton, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

Summary of Changes

This pull request addresses an indentation issue found by the Super-Linter in the ruby.proto file. The changes involve standardizing the indentation to use two spaces within message and enum definitions, improving the file's readability and consistency.

Highlights

  • Indentation Fix: The primary focus is to correct the indentation throughout the ruby.proto file, ensuring consistent formatting.
  • Super-Linter: The issue was initially identified by the Super-Linter, highlighting the importance of automated code quality checks.

Changelog

  • oss-fuzz/ruby.proto
    • Standardized indentation within message definitions (e.g., VarRef, ArrType, KVPair, HashType, StringExtNoArg, MathConst, Const, BinaryOp, UnaryOp, Rvalue, IfElse, Ternary, ObjectSpace, Time, Array, MathType, MathOps, BuiltinFuncs, Statement).
    • Corrected indentation within enum definitions (e.g., MathConstLit, OS_methods, T_methods, Arr_methods, Mops).
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.


Two spaces neatly aligned,
Code's beauty, refined.
Linter's keen eye,
Catches errors nigh,
Readability defined.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

The pull request addresses indentation issues in the ruby.proto file, identified by the Super-Linter. The changes appear to be straightforward and improve the file's readability. However, a closer look reveals some inconsistencies in the applied indentation.

Summary of Findings

  • Inconsistent Indentation: The primary issue is the inconsistent use of indentation throughout the ruby.proto file. While the intention was to standardize the indentation, the changes introduce a mix of single-space and double-space indentation, which detracts from the file's readability.

Merge Readiness

The pull request aims to improve code readability by standardizing indentation. However, due to the inconsistencies introduced, it's recommended that the author revisit the changes and ensure consistent indentation (preferably two spaces) throughout the file. I am unable to approve this pull request, and recommend that others review and approve this code before merging. It is not ready to be merged until the indentation issues are resolved.

@jbampton jbampton force-pushed the indent-ruby-proto branch from 399126f to 1c96c0b Compare May 13, 2025 11:53
@jbampton jbampton marked this pull request as draft May 13, 2025 12:00
@jbampton jbampton force-pushed the indent-ruby-proto branch from 1c96c0b to 500bd85 Compare May 13, 2025 12:02
@jbampton jbampton changed the title Standardize indents in ruby.proto Validate Protobuf with the Super-Linter May 13, 2025
@jbampton jbampton changed the title Validate Protobuf with the Super-Linter Validate / Lint Protobuf with the Super-Linter May 13, 2025
@jbampton jbampton force-pushed the indent-ruby-proto branch from 500bd85 to 9b5d930 Compare May 13, 2025 13:39
@github-actions github-actions bot added the build label May 13, 2025
@jbampton jbampton changed the title Validate / Lint Protobuf with the Super-Linter Add pre-commit hook protolint for Protocol Buffer files May 13, 2025
@jbampton jbampton force-pushed the indent-ruby-proto branch from 9b5d930 to 674b15e Compare May 13, 2025 14:14
Run `protolint -fix` to autofix some linter errors

Add `.protolint.yaml` config file and disable all rules for `comments`

https://github.com/yoheimuta/protolint

Hook usage listed here:

https://github.com/yoheimuta/protolint?tab=readme-ov-file#version-control-integration

Here is the style guide:

https://protobuf.dev/programming-guides/style/

Next link is an example config file:

https://github.com/yoheimuta/protolint/blob/master/_example/config/.protolint.yaml

Also updated `proto_to_ruby.cpp`
@jbampton jbampton force-pushed the indent-ruby-proto branch from 674b15e to 5a2b694 Compare May 13, 2025 14:31
@jbampton jbampton marked this pull request as ready for review May 13, 2025 14:53
@matz
Copy link
Member

matz commented May 14, 2025

Only concern is oss-fuzz is a contributed code and I do not maintain.

@matz
Copy link
Member

matz commented Nov 28, 2025

mruby itself does not use protobuf at all. the code under oss-fuzz are not maintained by us. thus I don't think we need to add protolint check.

@matz matz closed this Nov 28, 2025
@jbampton jbampton deleted the indent-ruby-proto branch November 28, 2025 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants