Skip to content

Implement usethis arch command#1451

Merged
nathanjmcdougall merged 7 commits intomainfrom
copilot/implement-usethis-arch
Mar 22, 2026
Merged

Implement usethis arch command#1451
nathanjmcdougall merged 7 commits intomainfrom
copilot/implement-usethis-arch

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 22, 2026

Adds usethis arch as a top-level command for architecture analysis tools, wrapping Import Linter — following the same pattern as usethis lint, usethis typecheck, etc.

Changes

  • New command usethis arch — CLI interface (_ui/interface/arch.py), toolset (_toolset/arch.py), registered in app.py under "Manage Tooling"
  • usethis init --arch — Opt-in flag (defaults to --no-arch) to include architecture analysis tooling during project initialization
  • Documentationdocs/cli/reference.md, docs/cli/overview.md, and README.md updated
  • .importlinter — Added arch to the ui_interface contract layers
  • Test coverage — Added test_arch_included in tests/usethis/_ui/interface/test_init.py to cover usethis init --arch
$ usethis arch                  # Add Import Linter to project
$ usethis arch --how            # Print usage instructions only
$ usethis arch --remove         # Remove Import Linter from project
$ usethis init --arch           # Include architecture analysis tools in init
Original prompt

This section details on the original issue you should resolve

<issue_title>Implement usethis arch</issue_title>
<issue_description>Similar to usethis lint, usethis typecheck etc. but for architecture tools. Will use Import Linter. Similar to the motivation for #1004.

Make sure to document both in docs but also README</issue_description>

Comments on the Issue (you are @copilot in this section)


⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.

Copilot AI and others added 2 commits March 22, 2026 06:01
Copilot AI changed the title [WIP] Add usethis arch for architecture tools Implement usethis arch command Mar 22, 2026
Copilot AI requested a review from nathanjmcdougall March 22, 2026 06:05
Copilot stopped work on behalf of nathanjmcdougall due to an error March 22, 2026 08:16
@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

@copilot let's say "architecture analysis tools" instead of "architecture tools" everywhere

…where

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/de1c1413-5ad8-48d8-ad0a-c891ad648a87
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 22, 2026

@copilot let's say "architecture analysis tools" instead of "architecture tools" everywhere

Updated all 7 occurrences across README.md, docs/cli/reference.md, src/usethis/_ui/app.py, src/usethis/_ui/interface/arch.py, and src/usethis/_ui/interface/init.py in commit d18a92f.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 22, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing copilot/implement-usethis-arch (a1e25e9) with main (95d1f5c)

Open in CodSpeed

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

@copilot you need to update the docs folder to match the readme. See test_assemble_readme_from_docs which is a failing test

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 22, 2026

@copilot you need to update the docs folder to match the readme. See test_assemble_readme_from_docs which is a failing test

Added the usethis arch entry to docs/cli/overview.md to match the README. test_assemble_readme_from_docs now passes. Fixed in 326b5f2.

@codecov
Copy link
Copy Markdown

codecov bot commented Mar 22, 2026

Codecov Report

❌ Patch coverage is 88.88889% with 3 lines in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/usethis/_ui/interface/arch.py 81.25% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@nathanjmcdougall
Copy link
Copy Markdown
Collaborator

@copilot please add a test to cover the case of usethis init --arch

Co-authored-by: nathanjmcdougall <18602289+nathanjmcdougall@users.noreply.github.com>
Agent-Logs-Url: https://github.com/usethis-python/usethis-python/sessions/10727609-7afc-4268-91ea-8bdc4e5e7c52
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 22, 2026

@copilot please add a test to cover the case of usethis init --arch

Added test_arch_included in tests/usethis/_ui/interface/test_init.py — verifies exit code, pyproject.toml creation, and the full expected output including the architecture analysis tools section. Fixed in 77a37ae.

@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review March 22, 2026 09:41
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a new top-level usethis arch CLI command to manage architecture analysis tooling (wrapping Import Linter), and integrates it into project initialization and documentation alongside existing usethis lint, usethis typecheck, etc.

Changes:

  • Introduces usethis arch command (UI interface + toolset) and registers it in the main Typer app.
  • Adds usethis init --arch/--no-arch flag (defaulting to opt-out) to include architecture tooling during init.
  • Updates docs/README and Import Linter layer contracts; adds tests for the new command and init flag.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/usethis/_ui/interface/arch.py New arch CLI interface wiring options/config context to toolset.
src/usethis/_toolset/arch.py New toolset entrypoint delegating to Import Linter core tool function.
src/usethis/_ui/app.py Registers usethis arch as a top-level command under “Manage Tooling”.
src/usethis/_ui/interface/init.py Adds --arch/--no-arch and runs architecture tooling during init when enabled.
tests/usethis/_ui/interface/test_arch.py Adds CLI-level tests for usethis arch.
tests/usethis/_ui/interface/test_init.py Adds coverage for usethis init --arch output.
docs/cli/reference.md Documents usethis arch and init --arch.
docs/cli/overview.md Adds usethis arch to CLI overview list.
README.md Mirrors CLI overview update for the new command.
.importlinter Adds arch to the ui_interface layering contract.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nathanjmcdougall nathanjmcdougall merged commit 93eebf1 into main Mar 22, 2026
23 of 44 checks passed
@nathanjmcdougall nathanjmcdougall deleted the copilot/implement-usethis-arch branch March 22, 2026 16:17
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.

Implement usethis arch

3 participants