Skip to content

Fix bug for create new file on toolchain project#66

Draft
q-inho wants to merge 1 commit into
mainfrom
dev/python_impl/toolchain/fix_bug
Draft

Fix bug for create new file on toolchain project#66
q-inho wants to merge 1 commit into
mainfrom
dev/python_impl/toolchain/fix_bug

Conversation

@q-inho

@q-inho q-inho commented Jul 24, 2025

Copy link
Copy Markdown
Member

Resolve #57

Fix

  • The create_new_file function now creates a mirrored documentation file whenever a new .hat source file is created inside a project. The docs file is placed under src/hat_docs/ with the same relative path as the source file and a .md extension.
  • Before creating a file, te tool now checkts that the target path resides within the current project's directory. If the resolved file path is outside the project, the operation is aborted with an error.
  • CLI ensures the users run hat new -f from within an existing project. If not, it reports a n error adn stops.
  • If the providedf ile path does not start wit hsrc/, it is automatically prefixed with src/ so that new files are placed in the correc tproject subdirectory.
  • The .hat extension is appended if it's missing from the given filename, ensuring connsistency.
  • If either the target source file or its documentation file already, it fail with an error isntead of overwriting them.

@q-inho q-inho self-assigned this Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Fix create new file on toolchain project

2 participants