Skip to content

chore: consolidate cursor rules at workspace level and enforce Python 3.12+#2286

Merged
Hartorn merged 1 commit intomainfrom
base-rules
Mar 9, 2026
Merged

chore: consolidate cursor rules at workspace level and enforce Python 3.12+#2286
Hartorn merged 1 commit intomainfrom
base-rules

Conversation

@Hartorn
Copy link
Copy Markdown
Member

@Hartorn Hartorn commented Mar 4, 2026

  • Create workspace-level cursor rules (python.mdc, documentation.mdc, guidelines.mdc)
  • Remove redundant giskard-checks rules (00-code-clean, 01-code-quality, 10-python)
  • Trim remaining giskard-checks rules (02-project, 03-development) to remove duplication
  • Delete CODEMAP.md (replaced by cursor rules and docstrings)
  • Bump giskard-agents requires-python from >=3.11 to >=3.12
  • Remove from __future__ import annotations from 12 source files (unnecessary with 3.12+)

@kevinmessiaen What do you think of those global simple rules for no ?

Description

Related Issue

Type of Change

  • 📚 Examples / docs / tutorials / dependencies update
  • 🔧 Bug fix (non-breaking change which fixes an issue)
  • 🥂 Improvement (non-breaking change which improves an existing feature)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 🔐 Security fix

Checklist

  • I've read the CODE_OF_CONDUCT.md document.
  • I've read the CONTRIBUTING.md guide.
  • I've written tests for all new methods and classes that I created.
  • I've written the docstring in Google format for all the methods and classes that I used.
  • I've updated the pdm.lock running pdm update-lock (only applicable when pyproject.toml has been
    modified)

… 3.12+

- Create workspace-level cursor rules (python.mdc, documentation.mdc, guidelines.mdc)
- Remove redundant giskard-checks rules (00-code-clean, 01-code-quality, 10-python)
- Trim remaining giskard-checks rules (02-project, 03-development) to remove duplication
- Delete CODEMAP.md (replaced by cursor rules and docstrings)
- Bump giskard-agents requires-python from >=3.11 to >=3.12
- Remove `from __future__ import annotations` from 12 source files (unnecessary with 3.12+)
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 significantly refactors the project's development guidelines and Python environment. By centralizing cursor rules and enforcing Python 3.12+, it aims to standardize coding practices, improve documentation consistency, and leverage modern Python features. These changes streamline the development workflow and reduce redundant documentation efforts, ensuring a more cohesive and up-to-date codebase.

Highlights

  • Cursor Rules Consolidation: Workspace-level cursor rules for documentation, general guidelines, and Python conventions have been created. This centralizes and standardizes development practices across the project.
  • Redundant Rule Removal: Several redundant giskard-checks specific cursor rules (00-code-clean, 01-code-quality, 10-python) have been removed, as their content is now covered by the new workspace-level rules.
  • Python Version Enforcement: The project now explicitly requires Python 3.12 or newer, reflected by updating the requires-python dependency in libs/giskard-agents/pyproject.toml.
  • Modern Python Syntax Adoption: The from __future__ import annotations import has been removed from 12 source files, as it is no longer necessary and can cause issues with Pydantic v2 in Python 3.12+.
  • Documentation Streamlining: The CODEMAP.md file has been deleted, as its purpose is now served by the new cursor rules and improved docstring practices, reducing maintenance overhead.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • .cursor/rules/documentation.mdc
    • Added new documentation and commenting guidelines for the workspace, emphasizing NumPy-style docstrings, inline comment best practices, and module-level docstrings.
  • .cursor/rules/guidelines.mdc
    • Added new team-wide guardrails for AI-assisted development, including rules against unrequested inventions, preserving existing code, and avoiding high-maintenance documentation like CODEMAP.
  • .cursor/rules/python.mdc
    • Added new Python conventions for the workspace, covering Python 3.12+ features (PEP 695, PEP 604, built-in generics, @override), Pydantic v2 usage, import/naming rules, async patterns, error handling, and testing practices.
  • libs/giskard-agents/pyproject.toml
    • Updated the requires-python dependency from >=3.11 to >=3.12.
  • libs/giskard-agents/src/giskard/agents/tools/_docstring_parser.py
    • Removed from __future__ import annotations import.
  • libs/giskard-checks/.cursor/rules/00-code-clean.mdc
    • Removed the file.
  • libs/giskard-checks/.cursor/rules/01-code-quality.mdc
    • Removed the file.
  • libs/giskard-checks/.cursor/rules/02-project.mdc
    • Updated description from 'overiew' to 'overview'.
    • Removed reference to CODEMAP.md from key files list.
    • Updated development workflow link from 02-development.mdc to 03-development.mdc.
    • Updated testing path from tests/integration/ to tests/ and removed redundant sections.
  • libs/giskard-checks/.cursor/rules/03-development.mdc
    • Trimmed redundant content, removing duplicate sections for 'Development Workflow', 'Quick Start', 'Common Commands', 'Pre-commit', and 'Guidelines'.
    • Removed reference to CODEMAP.md from 'See Also' section.
  • libs/giskard-checks/.cursor/rules/10-python.mdc
    • Removed the file.
  • libs/giskard-checks/CODEMAP.md
    • Removed the file.
  • libs/giskard-checks/src/giskard/checks/builtin/comparison.py
    • Removed from __future__ import annotations import.
  • libs/giskard-checks/src/giskard/checks/builtin/fn.py
    • Removed from __future__ import annotations import.
  • libs/giskard-checks/src/giskard/checks/builtin/text_matching.py
    • Removed from __future__ import annotations import.
  • libs/giskard-checks/src/giskard/checks/core/check.py
    • Removed from __future__ import annotations import.
  • libs/giskard-checks/src/giskard/checks/core/extraction.py
    • Removed from __future__ import annotations import.
  • libs/giskard-checks/src/giskard/checks/core/result.py
    • Removed from __future__ import annotations import.
    • Updated type hint for steps in ScenarioResult to use a string literal "TestCaseResult" for forward reference.
  • libs/giskard-checks/src/giskard/checks/core/scenario.py
    • Removed from __future__ import annotations import.
  • libs/giskard-checks/src/giskard/checks/core/testcase.py
    • Removed from __future__ import annotations import.
  • libs/giskard-checks/src/giskard/checks/scenarios/builder.py
    • Removed from __future__ import annotations import.
  • libs/giskard-checks/src/giskard/checks/scenarios/runner.py
    • Removed from __future__ import annotations import.
  • libs/giskard-checks/src/giskard/checks/testing/runner.py
    • Removed from __future__ import annotations import.
Activity
  • No human activity has been recorded on this pull request yet.
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
Copy Markdown
Contributor

@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 is a great initiative to consolidate and standardize the development guidelines by introducing workspace-level cursor rules and enforcing Python 3.12+. The changes, including the removal of redundant rule files, deletion of CODEMAP.md, and the consistent removal of unnecessary from __future__ import annotations imports, significantly improve the project's structure and maintainability. The code changes look solid and align well with the stated goals. One minor point of feedback: the new documentation rule (.cursor/rules/documentation.mdc) specifies NumPy-style docstrings, and the code changes seem to adhere to this. However, the PR description's checklist mentions "docstring in Google format". This is a small inconsistency, and it would be good to align the PR template with the new project standards.


scenario_name: str = Field(..., description="Scenario name")
steps: list[TestCaseResult] # TODO: rename to test_cases
steps: list["TestCaseResult"] # TODO: rename to test_cases
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The new documentation guidelines in .cursor/rules/documentation.mdc state that TODO comments should not be left without a linked issue or a clear owner. Please consider creating a GitHub issue for this planned refactoring and referencing it in the comment (e.g., # TODO(GH-123): rename to test_cases) or removing the TODO if it's not a priority.

References
  1. The documentation guidelines state that TODO comments should not be left without a linked issue or a clear owner. (link)


## Public API Docstrings

Every public class, method, and function **must** have a NumPy-style docstring that includes:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Let's also update the PR template based on gemini comment (.github/PULL_REQUEST_TEMPLATE.md)

However, the PR description's checklist mentions "docstring in Google format".

@kevinmessiaen
Copy link
Copy Markdown
Member

This also solve #2278

@kevinmessiaen kevinmessiaen linked an issue Mar 6, 2026 that may be closed by this pull request
@Hartorn Hartorn merged commit 06c3267 into main Mar 9, 2026
22 checks passed
@Hartorn Hartorn deleted the base-rules branch March 9, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Drop all from __future__ import annotations

2 participants