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
69 changes: 35 additions & 34 deletions .watchflow/rules.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,36 @@
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
- description: 'require_linked_issue: Block PRs without issue references to improve
traceability and reduce drive-by contributions.'
enabled: true
severity: high
event_types:
- pull_request
parameters: {}
- description: 'max_pr_size: Limit PR size to prevent large, hard-to-review changes
and encourage focused contributions.'
enabled: true
severity: medium
event_types:
- pull_request
parameters: {}
Comment on lines +9 to +15
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

Empty parameters will prevent max_pr_size from functioning.

The max_pr_size rule has no configured limit. Without specifying the maximum allowed lines or files, this rule cannot enforce any size constraint.

Suggested configuration
 - description: 'max_pr_size: Limit PR size to prevent large, hard-to-review changes
     and encourage focused contributions.'
   enabled: true
   severity: medium
   event_types:
   - pull_request
-  parameters: {}
+  parameters:
+    max_lines: 400
+    max_files: 20
🤖 Prompt for AI Agents
In @.watchflow/rules.yaml around lines 9 - 15, The rule entry for max_pr_size
has an empty parameters block so it doesn't enforce anything; update the rule
named max_pr_size to include concrete parameter keys (for example add integer
values for max_lines and/or max_files) under its parameters section so the rule
can enforce limits (e.g., parameters: { max_lines: 500, max_files: 50 }); keep
the existing enabled, severity, and event_types fields unchanged.

- description: 'code_owners: Enforce CODEOWNERS approval to prevent bypassing critical
code reviews and ensure vetted changes.'
enabled: true
severity: high
event_types:
- pull_request
parameters: {}
- description: 'required_workflows: Ensure CI workflows pass before merging to maintain
code quality and prevent regressions.'
enabled: true
severity: critical
event_types:
- pull_request
parameters: {}
Comment on lines +23 to +29
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

Empty parameters will prevent required_workflows from functioning.

This rule is marked critical but has no workflows specified. Without listing which CI workflows must pass, the rule cannot enforce anything.

Suggested configuration
 - description: 'required_workflows: Ensure CI workflows pass before merging to maintain
     code quality and prevent regressions.'
   enabled: true
   severity: critical
   event_types:
   - pull_request
-  parameters: {}
+  parameters:
+    workflows:
+      - ci
+      - build
+      - test
🤖 Prompt for AI Agents
In @.watchflow/rules.yaml around lines 23 - 29, The rule block for
required_workflows is missing configuration in the parameters section so it
can't enforce anything; update the rule named "required_workflows" (the entry
with description 'required_workflows: Ensure CI workflows pass...') by
populating its parameters with a non-empty list of workflow identifiers (e.g.,
add a workflows or required_workflows key containing the CI job names/IDs that
must pass) and validate the names match your CI workflow filenames/IDs so the
rule actually enforces on pull_request events.

- description: 'title_pattern: Enforce Conventional Commits pattern to improve commit
message clarity and automation.'
enabled: true
severity: medium
event_types:
- pull_request
parameters: {}
Comment on lines +30 to +36
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

Empty parameters will prevent title_pattern from functioning.

The description states this rule enforces "Conventional Commits pattern" but no regex pattern is provided. The rule needs the actual pattern to validate PR titles against.

Suggested configuration for Conventional Commits
 - description: 'title_pattern: Enforce Conventional Commits pattern to improve commit
     message clarity and automation.'
   enabled: true
   severity: medium
   event_types:
   - pull_request
-  parameters: {}
+  parameters:
+    pattern: '^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?: .+'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- description: 'title_pattern: Enforce Conventional Commits pattern to improve commit
message clarity and automation.'
enabled: true
severity: medium
event_types:
- pull_request
parameters: {}
- description: 'title_pattern: Enforce Conventional Commits pattern to improve commit
message clarity and automation.'
enabled: true
severity: medium
event_types:
- pull_request
parameters:
pattern: '^(feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\(.+\))?: .+'
🤖 Prompt for AI Agents
In @.watchflow/rules.yaml around lines 30 - 36, The rule's parameters are empty
so the title_pattern check never runs; add a parameters section including a
title_pattern regex that enforces Conventional Commits (e.g., a regex matching
types like feat|fix|chore etc., optional scope, and a subject) and an optional
error_message/description to surface on failure. Update the rule's parameters
key to include title_pattern (and optionally error_message) so the pull_request
event uses that regex when validating PR titles.