Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 24 additions & 34 deletions .watchflow/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,25 @@
rules:
# Essential Open Source Rules
- description: "Pull requests must have descriptive titles following conventional commit format"
enabled: true
severity: "medium"
event_types: ["pull_request"]
parameters:
title_pattern: "^feat|^fix|^docs|^style|^refactor|^test|^chore|^perf|^ci|^build|^revert"

- description: "New contributors require approval from at least one past contributor"
enabled: true
severity: "medium"
event_types: ["pull_request"]
parameters:
min_past_contributors: 1

- description: "Code changes must include corresponding tests"
enabled: true
severity: "medium"
event_types: ["pull_request"]
parameters:
pattern: "tests/.*\\.py$|test_.*\\.py$"
condition_type: "files_match_pattern"

- description: "Changes to critical files require review from code owners"
enabled: true
severity: "high"
event_types: ["pull_request"]

- description: "No direct pushes to main branch - all changes must go through PRs"
enabled: true
severity: "critical"
event_types: ["push"]
parameters:
allow_force_push: false
- key: require_linked_issue
name: Require Linked Issue
description: Block PRs without issue references to ensure traceability and context
for changes.
severity: high
category: quality
reasoning: The repository has an 85% unlinked issue rate, indicating most PRs lack
issue references which risks poor traceability and drive-by contributions.
- key: required_workflows
name: Require CI Workflow Pass
description: Ensure all PRs pass CI workflows before merging to maintain code quality
and prevent regressions.
severity: medium
category: quality
reasoning: The repository has established CI/CD workflows, so enforcing passing
CI before merge helps maintain quality and governance.
- key: title_pattern
name: Enforce Conventional Commit Titles
description: Require PR titles to follow Conventional Commit patterns (feat:, fix:,
etc.) for better changelog generation and clarity.
severity: medium
category: quality
reasoning: No explicit mention of commit message standards; enforcing title patterns
improves commit hygiene and project governance.
Comment on lines +18 to +25
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Watchflow title_pattern rule pattern field required documentation

💡 Result:

In Watchflow, title_pattern is a rule parameter (a string) used to enforce a pull request title format via a regular expression in your repository’s .watchflow/rules.yaml file. Example: parameters.title_pattern: "^[A-Z]+-[0-9]+: .+". [1]

It’s not a standalone “pattern” field at the top level—Watchflow rules are defined under rules: and commonly include fields like description, severity, event_types, and a parameters: map where rule-specific inputs (like title_pattern) live. [2]

If you’re using a “PR title must match …” rule, then title_pattern is effectively required for that rule to work, because it defines what the title must match. [1]

Sources: [1] [2]


Add parameters: section with regex pattern to enforce Conventional Commit titles.

The rule lacks the required title_pattern parameter. In Watchflow, title_pattern must be defined within a parameters: map as a regex string. Without it, the rule cannot validate PR titles. Update the rule to:

- key: title_pattern
  name: Enforce Conventional Commit Titles
  description: Require PR titles to follow Conventional Commit patterns (feat:, fix:,
    etc.) for better changelog generation and clarity.
  severity: medium
  category: quality
  reasoning: No explicit mention of commit message standards; enforcing title patterns
    improves commit hygiene and project governance.
  parameters:
    title_pattern: "^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\\(.+\\))?: .+"
🤖 Prompt for AI Agents
In @.watchflow/rules.yaml around lines 18 - 25, The rule entry with
key/title_pattern is missing the required parameters map; add a parameters:
section under the same rule and define title_pattern as a regex string that
enforces Conventional Commit titles (e.g., allowing scopes and a description),
ensuring you update the existing block that contains key: title_pattern, name:
Enforce Conventional Commit Titles, description, severity, category, and
reasoning to include parameters: title_pattern with the regex pattern shown in
the review.