Skip to content

feat: add PDEV team prefix to linear ref validation#34

Merged
jacr1 merged 3 commits intomainfrom
feat/add-pdev-linear-ref
Mar 10, 2026
Merged

feat: add PDEV team prefix to linear ref validation#34
jacr1 merged 3 commits intomainfrom
feat/add-pdev-linear-ref

Conversation

@jacr1
Copy link
Contributor

@jacr1 jacr1 commented Mar 10, 2026

Summary

  • Adds PDEV to the teams list in common.py so that PDEV-* Linear ticket references pass the pre-commit hook validation
  • PDEV is 4 characters and was not matched by the existing [A-Z]{3} fallback, requiring an explicit entry
  • Adds PDEV-1234 test cases to test_linear_ref, test_valid_commit_regex, test_commit_msg_issue_regex, and test_issue_regex

Test plan

  • Verify existing tests still pass
  • Verify commits with PDEV-* prefix are now accepted by the hook

🤖 Generated with Claude Code

Adds PDEV to the list of recognised Linear ticket prefixes so that
commits and branches using the PDEV-* format pass the pre-commit hook.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link

github-actions bot commented Mar 10, 2026

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
253 244 96% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
git_hooks/common.py 100% 🟢
git_hooks/test_commit_msg.py 100% 🟢
git_hooks/test_common.py 100% 🟢
TOTAL 100% 🟢

updated for commit: 08b2a94 by action🐍

@@ -34,7 +34,8 @@
teams: list[str] = [
"T",
Copy link
Member

Choose a reason for hiding this comment

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

lets just relax the rule to allow any 1 to 4 letter prefix?

Copy link
Member

Choose a reason for hiding this comment

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

think we can remove the teams block right?

jacr1 and others added 2 commits March 10, 2026 11:33
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jacr1 jacr1 merged commit 4dd70e2 into main Mar 10, 2026
1 check passed
@jacr1 jacr1 deleted the feat/add-pdev-linear-ref branch March 10, 2026 11:45
@gemini-code-assist
Copy link

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 enhances the commit message validation system by integrating support for the 'PDEV' team prefix in Linear ticket references. The changes involve updating the core configuration to recognize 'PDEV' and adjusting the regular expression logic to be more flexible with prefix lengths, ensuring that commits adhering to the 'PDEV-*' format are correctly validated by the pre-commit hook. Comprehensive test cases have been added to confirm the proper functioning of these updates.

Highlights

  • PDEV Team Prefix Support: Added 'PDEV' to the list of recognized team prefixes in common.py to ensure PDEV-* Linear ticket references pass pre-commit hook validation.
  • Flexible Linear Reference Regex: Updated the linear_ref regular expression to allow team prefixes of 1 to 4 characters (e.g., [A-Z]{1,4}), accommodating prefixes like 'PDEV' which are four characters long.
  • Expanded Test Coverage: Introduced new test cases for PDEV-1234 across test_linear_ref, test_valid_commit_regex, test_commit_msg_issue_regex, and test_issue_regex to validate the new prefix support.
Changelog
  • git_hooks/common.py
    • Added "PDEV" to the teams list.
    • Modified the linear_ref regex to accept 1 to 4 uppercase or lowercase characters for team prefixes.
  • git_hooks/test_commit_msg.py
    • Corrected the expected outcome for the X-5482/feat: Amazing new feature test case from 1 to 0.
  • git_hooks/test_common.py
    • Included PDEV-1234 in the test_linear_ref test cases.
    • Included PDEV-1234/feat: in the test_valid_commit_regex test cases.
    • Included PDEV-1234/feat: add something in the test_commit_msg_issue_regex test cases.
    • Included PDEV-1234 in the test_issue_regex test cases.
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 adds support for the PDEV team prefix in Linear ticket references for commit messages. The change correctly adds PDEV to the list of recognized teams and includes comprehensive test cases to validate the new prefix across different regex patterns. I have one suggestion to improve maintainability.

Comment on lines 35 to +38
"T",
"L2",
"DAE"
"DAE",
"PDEV"

Choose a reason for hiding this comment

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

medium

For better maintainability and to make it easier to check for existing teams in the future, it's a good practice to keep this list sorted alphabetically.

Suggested change
"T",
"L2",
"DAE"
"DAE",
"PDEV"
"DAE",
"L2",
"PDEV",
"T"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants