feat: per-language scorecards for mixed-language repositories#171
Open
xliry wants to merge 1 commit intopeteromallet:mainfrom
Open
feat: per-language scorecards for mixed-language repositories#171xliry wants to merge 1 commit intopeteromallet:mainfrom
xliry wants to merge 1 commit intopeteromallet:mainfrom
Conversation
…mallet#78) Adds --by-language flag to scan and status subcommands that generates per-language score sections and scorecard images for mixed-language repos. Changes: - languages/_framework/resolution.py: add discover_repo_languages() helper that returns {lang: file_count} for all detected languages in a project - engine/_state/schema.py: add optional dimension_scores_by_language field to StateModel (backwards-compatible, default absent) - app/cli_support/parser_groups.py: add --by-language to scan + status parsers - app/commands/scan/scan_reporting_by_language.py: new module with show_per_language_score_blocks() for per-language CLI score output - app/commands/scan/scan.py: add by-language execution phase that: * detects all languages (requires >=2) * runs scan generation per language in an isolated temp state * stores dimension_scores_by_language in state * prints per-language score blocks * emits per-language scorecard PNGs (scorecard-{lang}.png or {lang} template) - app/output/scorecard.py: add language kwarg to generate_scorecard() — when set, uses that language's dimension scores from state - app/commands/status_cmd.py: --by-language reads stored per-language scores and prints them before the aggregate dimension table; JSON output includes dimension_scores_by_language when present Closes: peteromallet#140 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements per-language scorecard generation for mixed-language repositories (fixes #140).
Changes
languages/_framework/resolution.py: Addeddiscover_repo_languages()helper that returns{lang: file_count}for all detected languagesengine/_state/schema.py: Added optionaldimension_scores_by_languagefield toStateModel(backwards-compatible)app/cli_support/parser_groups.py: Added--by-languageflag to bothscanandstatussubparsersapp/commands/scan/scan_reporting_by_language.py(new): Per-language CLI score output moduleapp/commands/scan/scan.py: Added by-language execution phase — detects languages, runs per-language scans, stores results, prints score blocks, emits per-language scorecard PNGsapp/output/scorecard.py: Addedlanguagekeyword arg togenerate_scorecard()— uses per-language dimension scores when setapp/commands/status_cmd.py:--by-languagereads stored per-language scores from stateUsage
Acceptance Criteria
--by-languageoutputs distinct score blocks per languagescorecard-go.png,scorecard-python.png)status --by-languageshows per-language breakdowndimension_scores_by_language, global scores unchanged)Closes #140