Skip to content

Commit 800410e

Browse files
committed
docs: improve docs
1 parent 61dea98 commit 800410e

File tree

5 files changed

+92
-52
lines changed

5 files changed

+92
-52
lines changed

CONTRIBUTING.md

Lines changed: 53 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,66 @@ I'm also open to feedback and suggestions for improving the project!
3737

3838
## Development Setup
3939

40+
### Prerequisites
41+
42+
- **Python 3.10+** - Modern Python runtime
43+
- **Poetry** - Dependency management ([install guide](https://python-poetry.org/docs/#installation))
44+
- **Make** - Build automation (usually pre-installed on Unix systems)
45+
- **Git** - Version control
46+
- **Graphviz** - Graph visualization ([install guide](https://graphviz.org/download/))
47+
48+
## Development Workflow
49+
50+
### 1. Fork and Setup
51+
4052
```bash
41-
git clone https://github.com/wisarootl/leetcode-py.git
53+
# Fork the repository on GitHub, then clone your fork
54+
git clone https://github.com/YOUR_USERNAME/leetcode-py.git
4255
cd leetcode-py
4356
poetry install
57+
58+
# Add upstream remote
59+
git remote add upstream https://github.com/wisarootl/leetcode-py.git
60+
61+
# Verify setup
62+
make test
63+
make lint
64+
```
65+
66+
### 2. Create Feature Branch
67+
68+
```bash
69+
git checkout -b your-feature-name
70+
```
71+
72+
### 3. Make Changes and Test
73+
74+
```bash
75+
# Test specific problem
76+
make p-test PROBLEM=problem_name
77+
78+
# Test all
4479
make test
80+
81+
# Lint your changes
82+
make lint
83+
84+
# Generate/regenerate problems (if needed)
85+
make p-gen PROBLEM=problem_name
4586
```
4687

47-
## Pull Request Process
88+
### 4. Submit Pull Request
89+
90+
```bash
91+
# Commit and push to your fork
92+
git add .
93+
git commit -m "feat: your descriptive commit message"
94+
git push origin your-feature-name
95+
96+
# Then create a pull request on GitHub from your fork to the main repository
97+
```
4898

49-
1. Fork the repository
50-
2. Create a feature branch
51-
3. Make your changes
52-
4. Run `make lint` and `make test`
53-
5. Ensure all GitHub Actions CI checks pass
54-
6. Submit a pull request with clear description
99+
**Ensure all GitHub Actions CI checks pass before requesting review.**
55100

56101
## Questions?
57102

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,14 @@ pip install leetcode-py-sdk
5454
lcpy gen -n 1 # Generate Two Sum
5555
lcpy gen -t grind-75 # Generate all Grind 75 problems
5656
lcpy list -t grind-75 # List available problems
57-
lcpy scrape -n 1 # Fetch problem data
5857

5958
# Start practicing
6059
cd leetcode/two_sum
6160
python -m pytest test_solution.py # Run tests
6261
# Edit solution.py, then rerun tests
6362
```
6463

65-
### Example
64+
### Bulk Generation Example
6665

6766
```bash
6867
lcpy gen --problem-tag grind-75 --output leetcode # Generate all Grind 75 problems

docs/cli-usage.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,23 @@ lcpy gen -s two-sum
6565
# Multiple problems by slug
6666
lcpy gen -s two-sum -s valid-palindrome
6767

68-
# All problems with specific tag
68+
# All problems with specific tag (bulk generation)
6969
lcpy gen -t grind-75
7070

71+
# Example: Generate all Grind 75 problems
72+
lcpy gen --problem-tag grind-75 --output leetcode
73+
```
74+
75+
![Problem Generation](https://raw.githubusercontent.com/wisarootl/leetcode-py/main/docs/images/problems-generation.png)
76+
77+
_Bulk generation output showing "Generated problem:" messages for all 75 Grind problems_
78+
79+
![Problem Generation 2](https://raw.githubusercontent.com/wisarootl/leetcode-py/main/docs/images/problems-generation-2.png)
80+
81+
_Generated folder structure showing all 75 problem directories after command execution_
82+
83+
```bash
84+
7185
# Filter by difficulty
7286
lcpy gen -t grind-75 -d Easy
7387

@@ -151,6 +165,18 @@ problem_name/
151165
└── __init__.py # Package marker
152166
```
153167

168+
![README Example](https://raw.githubusercontent.com/wisarootl/leetcode-py/main/docs/images/readme-example.png)
169+
170+
_README format that mirrors LeetCode's problem description layout_
171+
172+
![Solution Boilerplate](https://raw.githubusercontent.com/wisarootl/leetcode-py/main/docs/images/solution-boilerplate.png)
173+
174+
_Solution boilerplate with type hints and TODO placeholder_
175+
176+
![Test Example](https://raw.githubusercontent.com/wisarootl/leetcode-py/main/docs/images/test-example.png)
177+
178+
_Comprehensive parametrized tests with 10+ test cases - executable and debuggable in local development environment_
179+
154180
## Tags
155181

156182
Available tags for bulk operations:

docs/improvement-checklist.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

docs/llm-assisted-problem-creation.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,27 +75,25 @@ Each problem includes 10+ test cases covering edge cases (note: generated test c
7575

7676
_Generated test_solution.py with parametrized tests and comprehensive test cases_
7777

78-
## Test Enhancement Workflow
78+
## Test Enhancement & Verification
7979

80-
### Enhancing Existing Problems
80+
### Enhancing and Verifying Test Cases
8181

82-
Improve test coverage for existing problems:
82+
Improve test coverage and verify correctness for existing or newly generated problems:
83+
84+
**1. Run the tests:**
8385

8486
```bash
85-
"Enhance test cases for two_sum problem"
86-
"Add more edge cases to binary_tree_inorder_traversal"
87-
"Fix test reproducibility for valid_palindrome"
87+
make p-test PROBLEM={problem_name}
8888
```
8989

90-
### Quality Assurance
91-
92-
The assistant can identify problems needing more test cases and verify test case correctness and reproducibility:
90+
**2. Ask LLM to enhance or verify:**
9391

9492
```bash
93+
"Enhance test cases for {problem_name} problem"
94+
"Fix test reproducibility for {problem_name}"
9595
"Check which problems need more test cases"
9696
"Find problems with less than 12 test cases"
97-
"Verify test case correctness for house_robber"
98-
"Fix test reproducibility for binary_tree_inorder_traversal"
9997
```
10098

10199
## Best Practices
@@ -107,11 +105,13 @@ The assistant can identify problems needing more test cases and verify test case
107105
- "Add problem 198. House Robber with grind tag"
108106
- "Create problem 70. Climbing Stairs for grind-75"
109107
- "Enhance test cases for two_sum problem"
108+
- "Verify and fix test cases for binary_search problem"
110109

111110
**Avoid:**
112111

113112
- Vague requests without problem numbers
114113
- Requests for non-existent problems
114+
- Assuming generated test cases are always correct
115115

116116
## Troubleshooting
117117

0 commit comments

Comments
 (0)