From 2eddbcca31cfa1f693744a3b0f4a8e62b672ad9a Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 26 Jun 2026 04:28:26 +0000 Subject: [PATCH 1/4] fix: correct metadata escaping in project initialization script Metadata (description, author, email) was being escaped for TOML and then reused for Markdown, leading to incorrect backslashes appearing in docs/README.md. This change maintains separate raw and escaped versions to ensure correct formatting in both pyproject.toml and README.md. --- scripts/rename.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/rename.py b/scripts/rename.py index c2c359e..7ec9a97 100644 --- a/scripts/rename.py +++ b/scripts/rename.py @@ -98,9 +98,9 @@ def main(name: str, description: str, author: str, email: str, github: str): def toml_escape(s: str) -> str: return s.replace("\\", "\\\\").replace('"', '\\"') - description = toml_escape(description) - author = toml_escape(author) - email = toml_escape(email) + escaped_description = toml_escape(description) + escaped_author = toml_escape(author) + escaped_email = toml_escape(email) source = name.replace("-", "_").lower() @@ -138,8 +138,8 @@ def print_field(label: str, value: str): ("pyproject.toml", r"^source = \[.*\]", f'source = ["{source}"]'), ("pyproject.toml", r'^app = "project\.app:main"', f'app = "{source}.app:main"'), ("pyproject.toml", r'^name = ".*"', f'name = "{source}"'), - ("pyproject.toml", r'^description = ".*"', f'description = "{description}"'), - ("pyproject.toml", r"^authors = \[.*\]", f'authors = ["{author} <{email}>"]'), + ("pyproject.toml", r'^description = ".*"', f'description = "{escaped_description}"'), + ("pyproject.toml", r"^authors = \[.*\]", f'authors = ["{escaped_author} <{escaped_email}>"]'), ("docs/README.md", r"^# .*", f"# {description}"), (".github/CODEOWNERS", r"@.*", f"@{github}"), (".github/FUNDING.yml", r"^github: \[.*\]", f"github: [{github}]"), From 779a5d10c6ea7436f4ef84aa68dc2e8110f84422 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 26 Jun 2026 09:45:56 +0000 Subject: [PATCH 2/4] refactor: rename rename.py to init.py and fix metadata escaping - Renamed `scripts/rename.py` to `scripts/init.py` for better clarity. - Updated `pyproject.toml` and `mise.toml` to reflect the rename. - Fixed metadata escaping in the initialization script to ensure correct formatting in both `pyproject.toml` (escaped) and `README.md` (raw). - Updated documentation to use "Initialize" instead of "Rename". --- AGENTS.md | 1 + docs/README.md | 4 ++-- mise.toml | 9 ++++----- pyproject.toml | 2 +- scripts/{rename.py => init.py} | 0 5 files changed, 8 insertions(+), 8 deletions(-) rename scripts/{rename.py => init.py} (100%) diff --git a/AGENTS.md b/AGENTS.md index 13a13aa..09d14d2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -85,6 +85,7 @@ mise run project --name "my-project" --description "My app" --author "Your Name" | Deploy docs to GitHub Pages | `mise run docs` | | | Setup dev environment | `mise run dev` | | | Full setup from scratch | `mise run all` | | +| Initialize the project | `mise run project` | `p` | > Refer to `docs/README.md` for the full list of available targets. Add new targets to `mise.toml` as needed. diff --git a/docs/README.md b/docs/README.md index 21a8d00..7d949bd 100644 --- a/docs/README.md +++ b/docs/README.md @@ -39,8 +39,8 @@ Click this button to create a new repository for your project, then clone the ne [![Use this template]( https://img.shields.io/badge/Use%20this%20template-238636?style=for-the-badge)](https://github.com/amrabed/python/generate) -### Rename the project -After cloning the repository, rename the project by running: +### Initialize the project +After cloning the repository, initialize the project by running: ```bash mise run project ``` diff --git a/mise.toml b/mise.toml index 3780608..85e571f 100644 --- a/mise.toml +++ b/mise.toml @@ -91,10 +91,9 @@ description = "Run the app" alias = "a" run = "app" -[tasks.rename] -description = "Rename project (run once)" -alias = "r" -run = "rename" +[tasks.init] +description = "Initialize project (run once)" +run = "init" [tasks.project] -alias = ["rename", "p"] +alias = ["init", "p"] diff --git a/pyproject.toml b/pyproject.toml index a4e1eeb..eff2e9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,7 +12,7 @@ dependencies = [ [project.scripts] app = "project.app:main" -rename = "scripts.rename:main" +init = "scripts.init:main" [dependency-groups] dev = [ diff --git a/scripts/rename.py b/scripts/init.py similarity index 100% rename from scripts/rename.py rename to scripts/init.py From d7cfa0ec2bc74cdd3a12745b3b230e403bc5773b Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 26 Jun 2026 09:50:53 +0000 Subject: [PATCH 3/4] refactor: use init instead of rename/project tasks - Removed redundant `tasks.project` and `tasks.rename` in favor of `tasks.init`. - Set `p` as the alias for `tasks.init` to avoid conflict with `i` (install). - Updated all documentation references to use `mise run init`. - Ensured consistency across `mise.toml`, `AGENTS.md`, and `docs/README.md`. --- AGENTS.md | 2 +- docs/README.md | 2 +- mise.toml | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 09d14d2..b23c740 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -85,7 +85,7 @@ mise run project --name "my-project" --description "My app" --author "Your Name" | Deploy docs to GitHub Pages | `mise run docs` | | | Setup dev environment | `mise run dev` | | | Full setup from scratch | `mise run all` | | -| Initialize the project | `mise run project` | `p` | +| Initialize the project | `mise run init` | `p` | > Refer to `docs/README.md` for the full list of available targets. Add new targets to `mise.toml` as needed. diff --git a/docs/README.md b/docs/README.md index 7d949bd..379bfaa 100644 --- a/docs/README.md +++ b/docs/README.md @@ -42,7 +42,7 @@ Click this button to create a new repository for your project, then clone the ne ### Initialize the project After cloning the repository, initialize the project by running: ```bash -mise run project +mise run init ``` The script will interactively prompt you for the following details, with smart defaults based on your environment: diff --git a/mise.toml b/mise.toml index 85e571f..cd7041f 100644 --- a/mise.toml +++ b/mise.toml @@ -93,7 +93,6 @@ run = "app" [tasks.init] description = "Initialize project (run once)" +alias = "p" run = "init" -[tasks.project] -alias = ["init", "p"] From 56fa263c675449dbc94e4f29d8ca37e5e729d8ec Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 26 Jun 2026 09:57:21 +0000 Subject: [PATCH 4/4] refactor: remove alias for init task - Removed the `p` alias for the `init` task in `mise.toml`. - Updated `AGENTS.md` to remove the alias reference. - Kept the command as `mise run init`. --- AGENTS.md | 2 +- mise.toml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index b23c740..525c7e1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -85,7 +85,7 @@ mise run project --name "my-project" --description "My app" --author "Your Name" | Deploy docs to GitHub Pages | `mise run docs` | | | Setup dev environment | `mise run dev` | | | Full setup from scratch | `mise run all` | | -| Initialize the project | `mise run init` | `p` | +| Initialize the project | `mise run init` | | > Refer to `docs/README.md` for the full list of available targets. Add new targets to `mise.toml` as needed. diff --git a/mise.toml b/mise.toml index cd7041f..a22a627 100644 --- a/mise.toml +++ b/mise.toml @@ -93,6 +93,5 @@ run = "app" [tasks.init] description = "Initialize project (run once)" -alias = "p" run = "init"