Skip to content

Conversation

@rohan-019
Copy link
Contributor

Description

This PR updates the pre-commit configuration to improve consistency and formatting across the repository:

-Removed exclusion of ast.json and tokens.json from the end-of-file-fixer hook, so these files are now checked for a trailing newline.
-Manually added a newline at the end of ast.json to comply with the updated check.
-Updated .pre-commit-config.yaml to ensure consistent formatting enforcement across JSON, YAML, and other supported files.
-Removed redundant JSON beautification from b.sh since formatting is now fully handled by prettier and end-of-file-fixer.

Why

Ensures all tracked files, including ast.json and tokens.json, follow the same formatting rules.
-Prevents future inconsistencies or CI failures caused by missing trailing newlines.
-Simplifies tooling by relying on prettier + pre-commit hooks instead of custom formatting scripts.

Related Issue

#1051

Checklist

  • I have tested these changes locally.
  • My code follows the project's coding style guidelines.
  • I have reviewed my own code to ensure quality.
  • Unnecessary comments were removed.

Signed-off-by: rohan-019 <rohan18126@gmail.com>
Signed-off-by: rohan-019 <rohan18126@gmail.com>
@gemini-code-assist
Copy link

Summary of Changes

Hello @rohan-019, 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!

This pull request streamlines the repository's code formatting and consistency by centralizing JSON formatting under Prettier and pre-commit hooks. It ensures that all relevant files, including ast.json and tokens.json, adhere to standard formatting rules, thereby preventing future inconsistencies and simplifying the build process by removing custom formatting scripts.

Highlights

  • Pre-commit Configuration Update: The .pre-commit-config.yaml has been updated to extend Prettier's scope to include JSON files and to remove the exclusion of ast.json and tokens.json from the end-of-file-fixer hook, ensuring consistent formatting.
  • JSON File Formatting: ast.json and tokens.json now correctly end with a newline character, complying with the updated end-of-file-fixer hook requirements.
  • Script Simplification: Redundant JSON beautification logic has been removed from b.sh, as formatting is now fully handled by Prettier and the pre-commit hooks.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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 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. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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.

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

This pull request focuses on improving code formatting consistency by updating the pre-commit configuration. The changes correctly configure prettier to handle JSON files and enable end-of-file-fixer for ast.json and tokens.json. The removal of the manual JSON beautification logic from b.sh is a good simplification, centralizing formatting tasks to pre-commit hooks. The changes are well-aligned with the stated goals. I have one suggestion to ensure all modified files adhere to the new formatting standards.

@rohan-019
Copy link
Contributor Author

Hey @jbampton,
ignore file changes (ast.json and tokens.json)

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.

3 participants