-
Notifications
You must be signed in to change notification settings - Fork 49
Feature Request: Add Google Antigravity Support to Project CodeGuard - #71 #74
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
thomas-bartlett
merged 9 commits into
project-codeguard:main
from
Parveen-Birthaliya:antigravity-feature
Jan 6, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
45c47ef
add feature support of antigravity,with unit test and integration te…
Parveen-Birthaliya 624ffb3
Update src/formats/antigravity.py
santosomar d9b6956
Update src/formats/antigravity.py
santosomar 2897df0
Enhance Antigravity YAML frontmatter structure
Parveen-Birthaliya 5d53cdd
Fix typo in README.md for Antigravity
Parveen-Birthaliya 95c24cb
Fix capitalization in Google Antigravity section
Parveen-Birthaliya 0d6c1d5
Fix link to Google Antigravity Instructions
Parveen-Birthaliya b901ecc
Refine Antigravity format documentation
Parveen-Birthaliya d9d3e82
Update Google Antigravity to Antigravity in docs
Parveen-Birthaliya File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # Copyright 2025 Cisco Systems, Inc. and its affiliates | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """ | ||
| Antigravity Format Implementation | ||
|
|
||
| Generates .md rule files for Antigravity with YAML frontmatter. | ||
| """ | ||
|
|
||
| from formats.base import BaseFormat, ProcessedRule | ||
|
|
||
|
|
||
| class AntigravityFormat(BaseFormat): | ||
| """ | ||
| Antigravity format implementation (.md rule files). | ||
|
|
||
| Antigravity uses .md files with YAML frontmatter containing: | ||
| - trigger: 'always_on' or 'glob' (activation type) | ||
| - globs: (if trigger is 'glob') File matching patterns | ||
| - description: Rule description | ||
| - version: Rule version | ||
|
|
||
thomas-bartlett marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| Rules use activation types (Always On or Glob) to determine when | ||
| they apply, similar to Windsurf's implementation. | ||
| See: https://antigravity.google/docs/rules-workflows | ||
Parveen-Birthaliya marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| """ | ||
|
|
||
| def get_format_name(self) -> str: | ||
| """Return Antigravity format identifier.""" | ||
| return "antigravity" | ||
|
|
||
| def get_file_extension(self) -> str: | ||
| """Return Antigravity format file extension.""" | ||
| return ".md" | ||
|
|
||
| def get_output_subpath(self) -> str: | ||
| """Return Antigravity output subdirectory.""" | ||
| return ".agent/rules" | ||
|
|
||
| def generate(self, rule: ProcessedRule, globs: str) -> str: | ||
| """ | ||
| Generate Antigravity .md format with YAML frontmatter. | ||
|
|
||
| Args: | ||
| rule: The processed rule to format | ||
| globs: Glob patterns for file matching | ||
|
|
||
| Returns: | ||
| Formatted .md content with trigger, globs, description, and version | ||
|
|
||
| Note: | ||
| Antigravity rules use activation types: | ||
| - 'always_on': Rule applies to all files (when alwaysApply is true) | ||
| - 'glob': Rule applies to files matching glob patterns (language-specific) | ||
| """ | ||
| yaml_lines = [] | ||
|
|
||
| # Use trigger: always_on for rules that should always apply | ||
| if rule.always_apply: | ||
| yaml_lines.append("trigger: always_on") | ||
| else: | ||
| yaml_lines.append("trigger: glob") | ||
| yaml_lines.append(f"globs: {globs}") | ||
|
|
||
| # Add description (required by Antigravity spec) | ||
| desc = self._format_yaml_field("description", rule.description) | ||
| if desc: | ||
| yaml_lines.append(desc) | ||
|
|
||
| # Add version | ||
| yaml_lines.append(f"version: {self.version}") | ||
|
|
||
| return self._build_yaml_frontmatter(yaml_lines, rule.content) | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.