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
133 changes: 133 additions & 0 deletions .github/ISSUE_TEMPLATE/import_failure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: Import failure
description: Report a problem fetching a LeetCode question or generating its local files
title: "[Import failure]: "
labels:
- bug
body:
- type: markdown
attributes:
value: |
Thanks for reporting an import problem.

**Do not include browser cookies, `LEETCODE_SESSION`, CSRF tokens, personal solution code, or unredacted local paths.** Replace usernames and private directories with placeholders such as `<user>` or `<repo>`.

- type: dropdown
id: operation
attributes:
label: Operation
description: Which operation failed?
options:
- leet2git get
- leet2git import-all
- Source-file generation
- Test-file generation
- Other import-related operation
validations:
required: true

- type: input
id: problems
attributes:
label: LeetCode problem
description: Provide the public problem number and slug or URL. List every affected problem if there is more than one.
placeholder: "2917 — find-the-k-or-of-an-array"
validations:
required: true

- type: input
id: version
attributes:
label: leet2git version
description: Paste the package version from `leet2git --version`.
placeholder: "leet2git 0.3.0"
validations:
required: true

- type: input
id: python
attributes:
label: Python version
description: Paste the output of `python --version` or `uv run python --version`.
placeholder: "Python 3.11.13"
validations:
required: true

- type: dropdown
id: operating-system
attributes:
label: Operating system
options:
- Linux
- macOS
- Windows
- Other
validations:
required: true

- type: dropdown
id: language
attributes:
label: LeetCode language
options:
- python3
- python
- javascript
- java
- cpp
- Other
validations:
required: true

- type: textarea
id: command
attributes:
label: Command
description: Show the exact command after redacting private paths. Do not include cookie or token values.
placeholder: "leet2git --source-repository <repo> get 2917"
render: shell
validations:
required: true

- type: textarea
id: observed
attributes:
label: Observed behavior
description: Include the complete error message and what files, if any, were generated. Redact usernames and private paths.
validations:
required: true

- type: textarea
id: expected
attributes:
label: Expected behavior
description: Describe the files or outcome you expected.
validations:
required: true

- type: textarea
id: reproduction
attributes:
label: Reproduction steps
description: Provide the smallest reliable sequence that reproduces the problem, including whether it happens repeatedly.
placeholder: |
1. Log in to LeetCode in a supported local browser.
2. Run `leet2git ...`.
3. Observe ...
validations:
required: true

- type: textarea
id: additional-context
attributes:
label: Additional context
description: Add sanitized logs, screenshots, or relevant configuration flags. Do not attach generated personal solutions or authentication data.

- type: checkboxes
id: safety-checks
attributes:
label: Safety checks
options:
- label: I removed cookies, session values, CSRF tokens, personal solution code, and unredacted private paths.
required: true
- label: I searched existing issues for this problem number or error message.
required: true
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,4 @@ dmypy.json
.pyre/

# vscode
.vscode/
.vscode/
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,21 @@ The path to the code repository

- generate_tests: If true, will try to generate local test files for the question. Currently only python3 is supported.

## Limitations

leet2git imports the problem description and source template whenever those are available, even when it cannot safely generate a local test file. These test-generation limitations are reported as soft errors and do not cancel the source import.

Local tests are currently skipped for:

- Problems that depend on judge-provided objects such as `TreeNode`, `ListNode`, or `NestedInteger`.
- Interactive problems that call a hidden LeetCode oracle.
- Concurrency problems that require LeetCode's scheduler or callback harness.
- Problems whose examples use custom or in-place output validation, such as checking a mutated array prefix instead of only a return value.
- Problems whose example inputs or outputs cannot be parsed into a reliable generic assertion.

If LeetCode does not provide a source snippet for the selected language, there is no source file to import. This is common for language-specific problems such as SQL or JavaScript exercises when `python3` is selected.

Authentication failures, network or LeetCode API errors, and local source-file write errors can still prevent an import because no usable source file can be produced.

## Language Support

Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dependencies = [
"beautifulsoup4>=4.14.3",
"browser-cookie3>=0.20.1",
"click>=8.3.1",
"gitpython>=3.1.45",
"httpx>=0.28.1",
"platformdirs>=4.10.0",
"pydantic>=2.13.4",
Expand Down
Loading