You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: improve codegen testing and add verify target
- Add `make verify` for fast local validation suite
- Add AGENTS.md with repository guidelines for AI assistants
- Fix rust_writer.py: check for existing `impl Solution` before generating
- Refactor test_code_generation.py: align with dev snippet fixture, add design problem test
This repository stores LeetCode solutions, local runners, and code-generation tooling across several languages. Problem folders live under `problems/problems_<id>/` and usually contain `problem.md`, `problem_zh.md`, `solution.*`, `Solution.*`, `solution.md`, and testcase files. Shared language helpers are in `python/`, `golang/`, `typescript/`, `cpp/`, and `rust/`; reusable algorithm notes are in `algorithm_templates/`; metadata is in `data/`; automated tests are in `tests/`. Multithreading problems have their own layout under `multi_threading/<id>/`.
6
+
7
+
## Build, Test, and Development Commands
8
+
9
+
-`make verify`: run stable local checks across Python codegen/unit tests, TypeScript smoke tests, and Go helper packages.
10
+
-`make test`: run the full Python pytest suite with `PYTHONPATH=.`.
11
+
-`make test-unit`: run fast unit tests marked `unit`.
12
+
-`make test-integration`: run integration tests that may require language runtimes.
-`make test-coverage`: run pytest with terminal and HTML coverage reports.
15
+
-`npm test`: run the full TypeScript/Jest suite through `ts-jest`.
16
+
-`make test-go-libs`: run stable Go helper package tests.
17
+
-`python python/scripts/leetcode.py`: launch the interactive LeetCode helper for fetching/submitting problems.
18
+
19
+
Use `make help` for the maintained command list.
20
+
21
+
## Coding Style & Naming Conventions
22
+
23
+
Follow the style of the target language and existing generated files. Python uses pytest-compatible modules and 4-space indentation. Go code should be `gofmt` formatted. TypeScript uses lowercase filenames in `typescript/` and Jest test files such as `debug.test.ts`. Problem directories use `problems_<id>` naming, with language-specific solution names like `solution.py`, `solution.go`, `solution.ts`, `solution.rs`, `Solution.cpp`, and `Solution.java`.
24
+
25
+
## Testing Guidelines
26
+
27
+
Pytest discovers `test_*.py` and `*_test.py` under `tests/`; test classes start with `Test`, and test functions start with `test_`. Use markers from `pytest.ini`: `unit`, `integration`, `codegen`, and `slow`. For problem-level validation, run `make test-daily`, `make test-problems`, or the relevant language command. Add focused tests when changing code generation, language writers, shared models, or testcase parsing.
28
+
29
+
## Commit & Pull Request Guidelines
30
+
31
+
Recent commits use short prefixes such as `test:` and `fix:`; examples include `test: 3742 solution`, `test: [20260430] Add (3742)`, and `fix: 题解链接bug`. Keep messages imperative or descriptive, scoped to one change. Pull requests should summarize changed problems or tooling, list test commands run, mention required environment variables, and link related issues when applicable. Include screenshots only for documentation or UI-facing changes.
32
+
33
+
## Security & Configuration Tips
34
+
35
+
Do not commit `.env`, LeetCode cookies, PushDeer keys, or other secrets. Required local values include `COOKIE`, `PROBLEM_FOLDER`, `LANGUAGES`, `LEETCODE_USER`, and `PYTHONPATH=.`; see `README.md` for an example configuration.
0 commit comments