Skip to content

311 implement a rule management interface#540

Merged
nathanjmcdougall merged 23 commits intomainfrom
311-implement-a-rule-management-interface
Apr 26, 2025
Merged

311 implement a rule management interface#540
nathanjmcdougall merged 23 commits intomainfrom
311-implement-a-rule-management-interface

Conversation

@nathanjmcdougall
Copy link
Collaborator

No description provided.

@nathanjmcdougall nathanjmcdougall linked an issue Apr 21, 2025 that may be closed by this pull request
@codspeed-hq
Copy link

codspeed-hq bot commented Apr 22, 2025

CodSpeed Performance Report

Merging #540 will not alter performance

Comparing 311-implement-a-rule-management-interface (51ade51) with main (85f13c7)

Summary

✅ 1 untouched benchmarks

@nathanjmcdougall nathanjmcdougall marked this pull request as ready for review April 22, 2025 05:13
@nathanjmcdougall
Copy link
Collaborator Author

nathanjmcdougall commented Apr 22, 2025

Hmm, codecov is having trouble with the coverage reports.

These warnings are not related to #334, since they pre-date it:

/home/runner/work/usethis-python/usethis-python/.venv/lib/python3.13/site-packages/coverage/report_core.py:116: CoverageWarning: Couldn't parse '/home/runner/work/_temp/setup-uv-cache/.tmp1cC0gn/python/__init__.py': No source for code: '/home/runner/work/_temp/setup-uv-cache/.tmp1cC0gn/python/__init__.py'. (couldnt-parse)

@nathanjmcdougall
Copy link
Collaborator Author

nathanjmcdougall commented Apr 22, 2025

This won't be ready until:

  • we handle deselection differently from ignoring.
  • we revert adding "*setup-uv-cache/* to coverage ignores.
  • we have codecov working properly.

@codecov
Copy link

codecov bot commented Apr 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.45%. Comparing base (85f13c7) to head (51ade51).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #540      +/-   ##
==========================================
+ Coverage   97.39%   97.45%   +0.06%     
==========================================
  Files         100      102       +2     
  Lines        4336     4408      +72     
==========================================
+ Hits         4223     4296      +73     
+ Misses        113      112       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
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

This PR implements a rule management interface and updates various output messages to reflect the new terminology. Key changes include:

  • Revising messages from “Enabling/Disabling” to “Selecting/Deselecting” for Ruff rules.
  • Introducing a new CLI command for rule management via the “usethis rule” interface.
  • Updating tests and documentation to reflect the new command and messaging.

Reviewed Changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/usethis/_tool/impl/test_ruff.py Updated expected output messages to use “Selecting” instead of “Enabling”.
tests/usethis/_interface/test_tool.py Added a new test ensuring the deptry command runs successfully.
tests/usethis/_interface/test_rule.py Added tests for the rule management interface (select, deselect, ignore, unignore).
tests/usethis/_core/test_rule.py Updated tests covering rule selection and deselection behaviors.
tests/usethis/_core/test_docstyle.py Updated the expected docstyle message to use “Selecting” for rules.
tests/usethis/_core/test_core_tool.py Revised messages in tests to use “Deselecting” for rules.
src/usethis/_tool/impl/ruff.py Changed tick_print messages to consistently use “Selecting” and “Deselecting” wording.
src/usethis/_tool/impl/deptry.py Added an info_print message for deptry to indicate that its rules are implicitly selected.
src/usethis/_tool/base.py Extended the tool interface with a new unignore_rules method.
src/usethis/_interface/rule.py Introduced the new rule management CLI command.
src/usethis/_core/rule.py Implemented functions for mapping and managing rules for Ruff and Deptry.
src/usethis/_app.py Registered the new rule command in the CLI application.
pyproject.toml Updated layer configuration to include the new “rule” interface.
README.md Revised documentation to reflect the new rule command and updated output messages.

@nathanjmcdougall nathanjmcdougall merged commit cced25a into main Apr 26, 2025
17 checks passed
@nathanjmcdougall nathanjmcdougall deleted the 311-implement-a-rule-management-interface branch April 26, 2025 15:01
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 a rule management interface

2 participants