Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

project-create generates an invalid class name when the project name starts with a digit

Offen
#673 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

@Amadeus-22 arbeitet bereits daran.

Seit 06.10.2026.

  • #674 von @Amadeus-22 — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
Unter einer Stunde
Anfängerfreundlichkeit
40/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
python
Bereich
cli

Rechercherichtung

Find the code handling the project-create command in the lean-cli codebase, likely in a commands or templates directory. Look for the function that generates class names by removing non-alphanumeric characters from the project name. Add a check to prefix the result with an underscore when it starts with a digit or is empty, then add tests for project names like '2024 Momentum' and '123'.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Expected Behavior

lean project-create writes a main file that compiles, whatever the project name is.

Actual Behavior

The class name is the project name with non-alphanumeric characters removed. If the name starts with a digit, the generated class is not a valid identifier in Python or C#:

$ lean project-create --language python "2024 Momentum"
$ grep class "2024 Momentum/main.py"
class 2024Momentum(QCAlgorithm):

python -m py_compile on that file fails with SyntaxError: invalid decimal literal. A name with only digits (123) gives class 123(QCAlgorithm):. The command exits with code 0 in both cases, so the problem only shows up when the project is run.

Potential Solution

Prefix the class name with an underscore when it is empty or starts with a digit (_2024Momentum). I can open a PR with the fix and tests.

Reproducing the Problem

See the commands above.

System Information

lean-cli master at 20e58aa, Linux.

Checklist
  • I have completely filled out this template
  • I have confirmed that this issue exists on the current master branch
  • I have confirmed that this is not a duplicate issue by searching issues
Vorherrschende Sprache
Python
Sterne
327
Forks
169
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus QuantConnect/lean-cli

Alle Issues in QuantConnect/lean-cli

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.