Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move MetaWarning classes into new cli module #142

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Pennycook
Copy link
Contributor

Related issues

Part of #36, #96.

The CLI is the least well-tested part of Code Base Investigator, because its legacy implementation lived outside of the codebasin/ package and was therefore difficult to test. Refactoring common CLI functionality into a dedicated module, using functions with well-defined interfaces, will make this functionality more reliable.

Proposed changes

  • Move Formatter, MetaWarning and WarningAggregator into a new cli module.
  • Add missing docstrings.
  • Add unit tests for Formatter, MetaWarning and WarningAggregator.

Moving them out of __main__.py will make it easier to re-use them across
different command-line interfaces, and may make them easier to test.

While moving them, I also added the missing docstrings.

Signed-off-by: John Pennycook <[email protected]>
Signed-off-by: John Pennycook <[email protected]>
Signed-off-by: John Pennycook <[email protected]>
@Pennycook Pennycook added the refactor Improvements to code structure label Dec 17, 2024
@Pennycook Pennycook added this to the 2.0.0 milestone Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Improvements to code structure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant