Skip to content

docs(init): clarify --force behaviour in help and documentation - #2971

Merged
lengau merged 4 commits into
canonical:mainfrom
LoweRAM:work/bot/clarify-init-force-help-docs
Oct 23, 2026
Merged

lengau merged 4 commits into
canonical:mainfrom
LoweRAM:work/bot/clarify-init-force-help-docs

Conversation

@LoweRAM

@LoweRAM LoweRAM commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The --force option in charmcraft init had help text indicating it was needed to Initialize even if the directory is not empty (will not overwrite files). In reality, charmcraft init already allows non-empty directories as long as existing files do not conflict with the template. The --force flag is only required when files collide, in which case it permits initialisation without overwriting the conflicting files.

This change updates:

  • The --force option help text and command overview in charmcraft/application/commands/init.py.

Verification

  • make format
  • make lint-code
  • make test-fast

@LoweRAM
LoweRAM requested review from a team and lengau as code owners October 22, 2026 18:18
@lengau
lengau marked this pull request as draft October 22, 2026 18:29
@LoweRAM LoweRAM changed the title docs(init): clarify --force behavior in help and documentation docs(init): clarify --force behaviour in help and documentation Oct 22, 2026
@lengau
lengau requested review from a team and removed request for lengau October 22, 2026 18:34
@lengau
lengau marked this pull request as ready for review October 22, 2026 18:34
Copilot AI lite review requested due to automatic review settings October 22, 2026 18:34
@lengau

lengau commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator

Removing myself since it was my robot who made this.

CC @tromai and @dwilding since this affects what we discussed in #2921

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The documentation accurately reflects the existing initialization behavior, with no unresolved review issues.

No open issues 🎉

What changed in this PR

Clarifies the behavior of charmcraft init --force, explaining that non-empty directories are supported and that --force is only required when template files conflict with existing files.

Changes:

  • Updates the init command overview with collision behavior.
  • Clarifies that existing files are not overwritten.
  • Revises the --force option help text.
File Description
charmcraft/​application/​commands/​init.py Updates the init command overview and --force option help text.

Review effort: Lite

Comment thread charmcraft/application/commands/init.py Resolved
Comment thread charmcraft/application/commands/init.py Resolved
Co-authored-by: Imani Pelton <imani.pelton@canonical.com>
Signed-off-by: Alex Lowe <alex.lowe@canonical.com>
Comment thread charmcraft/application/commands/init.py Resolved
Signed-off-by: Alex Lowe <alex.lowe@canonical.com>
@lengau
lengau requested review from bepri and jahn-junior October 22, 2026 20:00

@jahn-junior jahn-junior left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@lengau
lengau merged commit f682e9d into canonical:main Oct 23, 2026
30 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants