这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
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
103 changes: 103 additions & 0 deletions .cursor/rules/pull_request_rules.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
---
description: Guidelines for creating pull requests, including pre-pull request checklist, preparation, and pull request content template
globs:
alwaysApply: false
---

# Pull Request Creation Guidelines

## 1. Pre-Pull Request Checklist

### 1.1 Run All Tests

Ensure all tests across the project are passing to maintain code reliability and
prevent regressions.

```shell
melos run test --no-select
```

### 1.2 Verify Code Analysis

Run static code analysis to identify potential issues, anti-patterns, and ensure
code quality standards are met.

```shell
dvm dart analyze
```

### 1.3 Verify Code Formatting

Ensure code follows the project's formatting standards for consistency across
the codebase.

```shell
melos format --output none --set-exit-if-changed
```

### 1.4 Remove Debug and Commented Code

Search through the codebase to ensure there are no unnecessary debug code or
commented-out code remaining.

### 1.5 Review Documentation Updates

Search through the codebase to verify if any documentation needs to be updated
to reflect the changes made in the pull request.

## 2. Pull Request Creation Process

### 2.1 Get Branch Name

Get your current working branch name.

```shell
git branch --show-current
```

### 2.2 Extract GitHub Issue Number

Extract the GitHub issue number from your branch name for reference.

```shell
# If your branch name is like `GH-[issue number]` or `GH-[issue number]/[brief description]`
git branch --show-current | grep -o 'GH-[0-9]\+' | grep -o '[0-9]\+'
```

### 2.3 Identify Base Branch

Determine the base branch for your pull request.

```shell
git symbolic-ref refs/remotes/origin/HEAD --short | sed 's#^origin/##'
```

### 2.4 Review Changed Files

List all modified, added, and deleted files between branches.

```shell
git diff {base branch}...HEAD --name-status
```

### 2.5 Review Code Changes

Examine the detailed code changes for each modified file.

```shell
git diff {base branch}...HEAD
```

### 2.6 Generate Pull Request Content

#### Title

- Format: `type(scope): description`
- type: feat, fix, docs, style, refactor, test, chore
- scope: stratos_core, stratos_app, etc.
- description: Brief description of changes in present tense
- Example: `feat(stratos_core): implement user authentication`

#### Description

Follow the [Pull Request Template](mdc:.github/PULL_REQUEST_TEMPLATE.md).
4 changes: 2 additions & 2 deletions .cursor/rules/tdd_rules.mdc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: TDD mandatory rules and best practices adopted in the Stratos project
globs: *.dart
alwaysApply: true
globs:
alwaysApply: false
---
# TDD (Test-Driven Development) Rules

Expand Down
4 changes: 2 additions & 2 deletions .cursor/rules/tdd_task_workflow.mdc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
description: Workflow for implementing features using Test-Driven Development
globs: *
alwaysApply: true
globs:
alwaysApply: false
---
# TDD Task Workflow

Expand Down
5 changes: 4 additions & 1 deletion .cursorignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
.dvm/

# GitHub related files
.github/
.github/*

# Not exclude pull request template
!.github/PULL_REQUEST_TEMPLATE.md

# VSCode related files
.vscode/
Expand Down
31 changes: 31 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## Related Issues

<!--
- Closes #123, #456
- Related #789
-->

## Overview

<!--
- Summary of implemented features or fixes
-->

## Changes

<!--
- List of specific changes
-->

## Review Points

<!--
- Specific points for reviewers to check
- Concerns or points for discussion
-->

## Additional Notes

<!--
- Supplementary information or reference links
-->