Skip to content

Clean up dotfile created by test runs#1740

Merged
rolandwalker merged 1 commit intomainfrom
RW/tox-dotfile-cleanup
Mar 25, 2026
Merged

Clean up dotfile created by test runs#1740
rolandwalker merged 1 commit intomainfrom
RW/tox-dotfile-cleanup

Conversation

@rolandwalker
Copy link
Copy Markdown
Contributor

Description

Running the full test suite via tox seems to create a .myclirc file in the repo root, which can cause trouble later, including failures in subsequent test runs. Add a tox cleanup step to remove the dotfile.

It's not clear where or how this file gets created, but it is easy enough to unconditionally delete it.

The feature of reading from a .myclirc file in the current working directory is also questionable! Perhaps a warning should always be shown.

Checklist

  • I added this contribution to the changelog.md file.
  • I added my name to the AUTHORS file (or it's already there).
  • To lint and format the code, I ran
    uv run ruff check && uv run ruff format && uv run mypy --install-types .

Running the full test suite via tox seems to create a .myclirc file in
the repo root, which can cause trouble later, including failures in
subsequent test runs.  Add a tox cleanup step to remove the dotfile.
@rolandwalker rolandwalker self-assigned this Mar 24, 2026
@github-actions
Copy link
Copy Markdown

  1. Potential data-loss regression for local repo config
    commands_post = rm -f -- ./.myclirc will always delete a project-local .myclirc after tox runs, even if it existed before tests. This can remove a developer’s intentional repo-scoped config (which mycli explicitly supports via pwd_config_file).
    File: tox.ini
    Action: only remove files created by the test run (e.g., track pre-existence in commands_pre/post logic), or isolate tests so they never write to repo root.

  2. Portability regression in test runner cleanup
    Using external rm in tox post-commands is Unix-specific and will fail on environments without rm (notably Windows).
    Files: tox.ini, tox.ini
    Action: replace with a cross-platform Python cleanup command (for example python -c "from pathlib import Path; Path('.myclirc').unlink(missing_ok=True)") and allowlist python if needed.

No security-specific issues found in this PR.

@rolandwalker rolandwalker merged commit 07db3a6 into main Mar 25, 2026
10 checks passed
@rolandwalker rolandwalker deleted the RW/tox-dotfile-cleanup branch March 25, 2026 19:27
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.

1 participant